diff options
author | David Ahern <dsa@cumulusnetworks.com> | 2015-10-21 17:44:29 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-11-01 16:54:03 (GMT) |
commit | 493bbd13e6d96c61e844dd1c04aa7218d0b7da08 (patch) | |
tree | cb47114e902a28be329940f65fa59296c1dc4e4a /include | |
parent | f25138d3214cefba0dc992ce7a408de580fd3dcd (diff) | |
download | libnl-493bbd13e6d96c61e844dd1c04aa7218d0b7da08.zip libnl-493bbd13e6d96c61e844dd1c04aa7218d0b7da08.tar.gz libnl-493bbd13e6d96c61e844dd1c04aa7218d0b7da08.tar.bz2 |
route/vrf: add VRF support
http://lists.infradead.org/pipermail/libnl/2015-October/001991.html
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
[thaller@redhat.com: slightly modified original patch]
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile.am | 1 | ||||
-rw-r--r-- | include/linux-private/linux/if_link.h | 9 | ||||
-rw-r--r-- | include/netlink/route/link/vrf.h | 32 |
3 files changed, 42 insertions, 0 deletions
diff --git a/include/Makefile.am b/include/Makefile.am index ffaa9a5..84487a4 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -61,6 +61,7 @@ nobase_libnlinclude_HEADERS = \ netlink/route/link/ipvti.h \ netlink/route/link/sit.h \ netlink/route/link/ipvlan.h \ + netlink/route/link/vrf.h \ netlink/route/qdisc/cbq.h \ netlink/route/qdisc/dsmark.h \ netlink/route/qdisc/fifo.h \ diff --git a/include/linux-private/linux/if_link.h b/include/linux-private/linux/if_link.h index 3d0d613..af4a8f9 100644 --- a/include/linux-private/linux/if_link.h +++ b/include/linux-private/linux/if_link.h @@ -337,6 +337,15 @@ enum macvlan_macaddr_mode { #define MACVLAN_FLAG_NOPROMISC 1 +/* VRF section */ +enum { + IFLA_VRF_UNSPEC, + IFLA_VRF_TABLE, + __IFLA_VRF_MAX +}; + +#define IFLA_VRF_MAX (__IFLA_VRF_MAX - 1) + /* IPVLAN section */ enum { IFLA_IPVLAN_UNSPEC, diff --git a/include/netlink/route/link/vrf.h b/include/netlink/route/link/vrf.h new file mode 100644 index 0000000..0a56d91 --- /dev/null +++ b/include/netlink/route/link/vrf.h @@ -0,0 +1,32 @@ +/* + * netlink/route/link/vrf.h VRF interface + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation version 2.1 + * of the License. + * + * Copyright (c) 2015 Cumulus Networks. All rights reserved. + * Copyright (c) 2015 David Ahern <dsa@cumulusnetworks.com> + */ + +#ifndef NETLINK_LINK_VRF_H_ +#define NETLINK_LINK_VRF_H_ + +#include <netlink/netlink.h> +#include <netlink/route/link.h> + +#ifdef __cplusplus +extern "C" { +#endif + +extern struct rtnl_link *rtnl_link_vrf_alloc(void); +extern int rtnl_link_is_vrf(struct rtnl_link *link); +extern int rtnl_link_vrf_get_tableid(struct rtnl_link *link, uint32_t *id); +extern int rtnl_link_vrf_set_tableid(struct rtnl_link *link, uint32_t id); + +#ifdef __cplusplus +} +#endif + +#endif |