libnl/include
roopa 690264a193 Add new object op oo_id_attrs_get
The current oo_id_attrs nl_object op allows a fixed
id attribute list for an cache. But a cache with multiple families
may need to specify different id attributes for different families.

An example for this is the bridge fdb entries in the neigh cache:
neigh entries belonging to the AF_UNSPEC family use
(NEIGH_ATTR_IFINDEX | NEIGH_ATTR_DST | NEIGH_ATTR_FAMILY) as id attributes.
AF_BRIDGE fdb entries which also support the same msg type, will need to use
(NEIGH_ATTR_LLADDR | NEIGH_ATTR_FAMILY) as id attributes.
Today you cannot specify different set of attributes to two families belonging
to the same cache.

This patch adds a new object function oo_id_attrs_get to get the attributes.
An example implementation of oo_id_attrs_get for the neigh cache will
look like:
static uint32_t neigh_id_attrs_get(struct nl_object *obj)
{
        struct rtnl_neigh *neigh = (struct rtnl_neigh *)obj;

        if (neigh->n_family == AF_BRIDGE)
                return (NEIGH_ATTR_LLADDR | NEIGH_ATTR_FAMILY);
        else
                return (NEIGH_ATTR_IFINDEX | NEIGH_ATTR_DST | NEIGH_ATTR_FAMILY);
}

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Nolan Leake <nolan@cumulusnetworks.com>
Reviewed-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
2012-11-05 13:31:55 +01:00
..
linux Merge branch 'master' of https://github.com/rmfought/libnl 2012-10-26 12:48:22 +02:00
netlink Add new object op oo_id_attrs_get 2012-11-05 13:31:55 +01:00
Makefile.am Checkpoint before compilation attempt 2012-10-08 15:26:55 -07:00
netlink-generic.h Initial import 2007-09-15 01:28:01 +02:00
netlink-local.h Don't redefine offsetof when already defined by e.g. stddef.h 2011-06-21 11:33:44 +02:00
netlink-tc.h Unified TC API 2011-03-21 15:51:52 +01:00
netlink-types.h Merge branch 'master' of https://github.com/rmfought/libnl 2012-10-26 12:48:22 +02:00