[RFC PATCH 1/4] Add new object op oo_id_attrs_get

Thomas Graf tgraf at suug.ch
Mon Nov 5 10:28:25 EST 2012


On 11/05/12 at 05:39am, roopa at cumulusnetworks.com wrote:
> From: roopa <roopa at cumulusnetworks.com>
> 
> 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 at cumulusnetworks.com>
> Reviewed-by: Nolan Leake <nolan at cumulusnetworks.com>
> Reviewed-by: Shrijeet Mukherjee <shm at cumulusnetworks.com>
> Reviewed-by: Wilson Kok <wkok at cumulusnetworks.com>
> 

Applied, thanks.



More information about the libnl mailing list