Logo Search packages:      
Sourcecode: libnl2 version File versions  Download package

struct genl_family* genl_ctrl_search_by_name ( struct nl_cache *  cache,
const char *  name 
) [read]

Look up generic netlink family by family name in the provided cache.

  • cache Generic netlink family cache.
  • name Family name.
Searches through the cache looking for a registered family matching the specified name. The caller will own a reference on the returned object which needs to be given back after usage using genl_family_put().

Returns:
Generic netlink family object or NULL if no match was found.

Definition at line 192 of file ctrl.c.

References nl_object_get().

Referenced by genl_ctrl_resolve().

{
      struct genl_family *fam;

      if (cache->c_ops != &genl_ctrl_ops)
            BUG();

      nl_list_for_each_entry(fam, &cache->c_items, ce_list) {
            if (!strcmp(name, fam->gf_name)) {
                  nl_object_get((struct nl_object *) fam);
                  return fam;
            }
      }

      return NULL;
}


Generated by  Doxygen 1.6.0   Back to index