From: David Ahern <dsahern@kernel.org>
To: stephen@networkplumber.org
Cc: netdev@vger.kernel.org, David Ahern <dsahern@gmail.com>
Subject: [PATCH iproute2-next 4/9] uapi: Import nexthop object API
Date: Wed, 29 May 2019 20:17:41 -0700 [thread overview]
Message-ID: <20190530031746.2040-5-dsahern@kernel.org> (raw)
In-Reply-To: <20190530031746.2040-1-dsahern@kernel.org>
From: David Ahern <dsahern@gmail.com>
Add nexthop.h from kernel with the uapi for nexthop objects.
Signed-off-by: David Ahern <dsahern@gmail.com>
---
include/uapi/linux/nexthop.h | 56 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
create mode 100644 include/uapi/linux/nexthop.h
diff --git a/include/uapi/linux/nexthop.h b/include/uapi/linux/nexthop.h
new file mode 100644
index 000000000000..b56c5b895476
--- /dev/null
+++ b/include/uapi/linux/nexthop.h
@@ -0,0 +1,56 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+#ifndef _LINUX_NEXTHOP_H
+#define _LINUX_NEXTHOP_H
+
+#include <linux/types.h>
+
+struct nhmsg {
+ unsigned char nh_family;
+ unsigned char nh_scope; /* return only */
+ unsigned char nh_protocol; /* Routing protocol that installed nh */
+ unsigned char resvd;
+ unsigned int nh_flags; /* RTNH_F flags */
+};
+
+/* entry in a nexthop group */
+struct nexthop_grp {
+ __u32 id; /* nexthop id - must exist */
+ __u8 weight; /* weight of this nexthop */
+ __u8 resvd1;
+ __u16 resvd2;
+};
+
+enum {
+ NEXTHOP_GRP_TYPE_MPATH, /* default type if not specified */
+ __NEXTHOP_GRP_TYPE_MAX,
+};
+
+#define NEXTHOP_GRP_TYPE_MAX (__NEXTHOP_GRP_TYPE_MAX - 1)
+
+enum {
+ NHA_UNSPEC,
+ NHA_ID, /* u32; id for nexthop. id == 0 means auto-assign */
+
+ NHA_GROUP, /* array of nexthop_grp */
+ NHA_GROUP_TYPE, /* u16 one of NEXTHOP_GRP_TYPE */
+ /* if NHA_GROUP attribute is added, no other attributes can be set */
+
+ NHA_BLACKHOLE, /* flag; nexthop used to blackhole packets */
+ /* if NHA_BLACKHOLE is added, OIF, GATEWAY, ENCAP can not be set */
+
+ NHA_OIF, /* u32; nexthop device */
+ NHA_GATEWAY, /* be32 (IPv4) or in6_addr (IPv6) gw address */
+ NHA_ENCAP_TYPE, /* u16; lwt encap type */
+ NHA_ENCAP, /* lwt encap data */
+
+ /* NHA_OIF can be appended to dump request to return only
+ * nexthops using given device
+ */
+ NHA_GROUPS, /* flag; only return nexthop groups in dump */
+ NHA_MASTER, /* u32; only return nexthops with given master dev */
+
+ __NHA_MAX,
+};
+
+#define NHA_MAX (__NHA_MAX - 1)
+#endif
--
2.11.0
next prev parent reply other threads:[~2019-05-30 4:04 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-30 3:17 [PATCH iproute2-next 0/9] ip: Add support for nexthop objects David Ahern
2019-05-30 3:17 ` [PATCH iproute2-next 1/9] libnetlink: Set NLA_F_NESTED in rta_nest David Ahern
2019-05-30 17:43 ` Stephen Hemminger
2019-05-30 17:50 ` David Ahern
2019-05-31 6:35 ` Michal Kubecek
2019-05-30 3:17 ` [PATCH iproute2-next 2/9] lwtunnel: Pass encap and encap_type attributes to lwt_parse_encap David Ahern
2019-05-30 3:17 ` [PATCH iproute2-next 3/9] libnetlink: Add helper to add a group via setsockopt David Ahern
2019-05-30 3:17 ` David Ahern [this message]
2019-05-30 3:17 ` [PATCH iproute2-next 5/9] libnetlink: Add helper to create nexthop dump request David Ahern
2019-05-30 19:56 ` Roopa Prabhu
2019-05-30 19:59 ` David Ahern
2019-05-30 3:17 ` [PATCH iproute2-next 6/9] ip route: Export print_rt_flags and print_rta_if David Ahern
2019-05-30 3:17 ` [PATCH iproute2-next 7/9] Add support for nexthop objects David Ahern
2019-05-30 17:45 ` Stephen Hemminger
2019-05-30 17:52 ` David Ahern
2019-05-30 17:45 ` Stephen Hemminger
2019-05-30 17:52 ` David Ahern
2019-05-30 17:52 ` Stephen Hemminger
2019-05-30 17:55 ` David Ahern
2019-05-30 20:01 ` Roopa Prabhu
2019-05-30 3:17 ` [PATCH iproute2-next 8/9] ip route: Add option to use " David Ahern
2019-05-30 19:59 ` Roopa Prabhu
2019-05-30 3:17 ` [PATCH iproute2-next 9/9] ipmonitor: Add nexthop option to monitor David Ahern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190530031746.2040-5-dsahern@kernel.org \
--to=dsahern@kernel.org \
--cc=dsahern@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).