summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2017-05-03 21:05:06 (GMT)
committerThomas Haller <thaller@redhat.com>2017-05-12 08:09:15 (GMT)
commitd55f004c5ad4b202cab5593551554cdad4f1a444 (patch)
tree2b32b2e5137b445e065a9f787bc15569d8e12f54 /include
parentb5513d46aa7917676cdc9cf2cc7c9e376d6c36b1 (diff)
downloadlibnl-d55f004c5ad4b202cab5593551554cdad4f1a444.zip
libnl-d55f004c5ad4b202cab5593551554cdad4f1a444.tar.gz
libnl-d55f004c5ad4b202cab5593551554cdad4f1a444.tar.bz2
route: Add support for netconf
Add route/netconf cache type to monitor RTM_*NETCONF messages. v2 - change get methods to return 0/error and take 'int *val' which is set to the value requested Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: Balakrishnan Raman <ramanb@cumulusnetworks.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux-private/linux/netconf.h27
-rw-r--r--include/linux-private/linux/rtnetlink.h2
-rw-r--r--include/netlink/route/netconf.h43
3 files changed, 72 insertions, 0 deletions
diff --git a/include/linux-private/linux/netconf.h b/include/linux-private/linux/netconf.h
new file mode 100644
index 0000000..ec14058
--- /dev/null
+++ b/include/linux-private/linux/netconf.h
@@ -0,0 +1,27 @@
+#ifndef __LINUX_NETCONF_H_
+#define __LINUX_NETCONF_H_
+
+#include <linux/types.h>
+#include <linux/netlink.h>
+
+struct netconfmsg {
+ __u8 ncm_family;
+};
+
+enum {
+ NETCONFA_UNSPEC,
+ NETCONFA_IFINDEX,
+ NETCONFA_FORWARDING,
+ NETCONFA_RP_FILTER,
+ NETCONFA_MC_FORWARDING,
+ NETCONFA_PROXY_NEIGH,
+ NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN,
+ __NETCONFA_MAX
+};
+#define NETCONFA_MAX (__NETCONFA_MAX - 1)
+#define NETCONFA_ALL -1
+
+#define NETCONFA_IFINDEX_ALL -1
+#define NETCONFA_IFINDEX_DEFAULT -2
+
+#endif /* __LINUX_NETCONF_H_ */
diff --git a/include/linux-private/linux/rtnetlink.h b/include/linux-private/linux/rtnetlink.h
index 3244947..7d94908 100644
--- a/include/linux-private/linux/rtnetlink.h
+++ b/include/linux-private/linux/rtnetlink.h
@@ -122,6 +122,8 @@ enum {
RTM_NEWNETCONF = 80,
#define RTM_NEWNETCONF RTM_NEWNETCONF
+ RTM_DELNETCONF,
+#define RTM_DELNETCONF RTM_DELNETCONF
RTM_GETNETCONF = 82,
#define RTM_GETNETCONF RTM_GETNETCONF
diff --git a/include/netlink/route/netconf.h b/include/netlink/route/netconf.h
new file mode 100644
index 0000000..d2d1f9b
--- /dev/null
+++ b/include/netlink/route/netconf.h
@@ -0,0 +1,43 @@
+/*
+ * netlink/route/netconf.h rtnetlink netconf layer
+ *
+ * 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) 2017 David Ahern <dsa@cumulusnetworks.com>
+ */
+
+#ifndef NETCONF_H_
+#define NETCONF_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct rtnl_netconf;
+
+int rtnl_netconf_alloc_cache(struct nl_sock *sk, struct nl_cache **result);
+
+struct rtnl_netconf *rtnl_netconf_get_by_idx(struct nl_cache *cache, int family,
+ int ifindex);
+struct rtnl_netconf *rtnl_netconf_get_all(struct nl_cache *cache,
+ int family);
+struct rtnl_netconf *rtnl_netconf_get_default(struct nl_cache *cache,
+ int family);
+void rtnl_netconf_put(struct rtnl_netconf *nc);
+
+int rtnl_netconf_get_family(struct rtnl_netconf *nc, int *val);
+int rtnl_netconf_get_ifindex(struct rtnl_netconf *nc, int *val);
+int rtnl_netconf_get_forwarding(struct rtnl_netconf *nc, int *val);
+int rtnl_netconf_get_mc_forwarding(struct rtnl_netconf *nc, int *val);
+int rtnl_netconf_get_rp_filter(struct rtnl_netconf *nc, int *val);
+int rtnl_netconf_get_proxy_neigh(struct rtnl_netconf *nc, int *val);
+int rtnl_netconf_get_ignore_routes_linkdown(struct rtnl_netconf *nc, int *val);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif