[PATCH libnl 1/4] route: Add support for netconf
Thomas Haller
thaller at redhat.com
Wed May 3 06:04:53 PDT 2017
Hi David,
On Thu, 2017-04-27 at 13:42 -0700, David Ahern wrote:
> Add route/netconf cache type to monitor RTM_*NETCONF messages.
>
> Signed-off-by: David Ahern <dsa at cumulusnetworks.com>
> Signed-off-by: Balakrishnan Raman <ramanb at cumulusnetworks.com>
> ---
> +int rtnl_netconf_get_family(struct rtnl_netconf *nc);
> +int rtnl_netconf_get_ifindex(struct rtnl_netconf *nc);
> +int rtnl_netconf_get_forwarding(struct rtnl_netconf *nc);
> +int rtnl_netconf_get_mc_forwarding(struct rtnl_netconf *nc);
> +int rtnl_netconf_get_rp_filter(struct rtnl_netconf *nc);
> +int rtnl_netconf_get_proxy_neigh(struct rtnl_netconf *nc);
> +int rtnl_netconf_get_ignore_routes_linkdown(struct rtnl_netconf
> *nc);
the underlying fields for these properties are "int" (in the netlink
message they are s32). How about having the getters to have a distinct
return and error value? For example:
int rtnl_netconf_get_family(struct rtnl_netconf *nc,
int *out_value)
{
if (!nc)
return -NLE_INVAL;
if (!(nc->mask & NETCONF_ATTR_FAMILY))
return -NLE_MISSING_ATTR;
if (out_value)
*out_value = nc->family;
return 0;
}
What's your opinion about that?
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20170503/7899089f/attachment.sig>
More information about the libnl
mailing list