]>
Commit | Line | Data |
---|---|---|
c16c7808 | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
d3678e3a YW |
2 | #ifndef _UAPI_LINUX_NEXTHOP_H |
3 | #define _UAPI_LINUX_NEXTHOP_H | |
c16c7808 SS |
4 | |
5 | #include <linux/types.h> | |
6 | ||
7 | struct nhmsg { | |
d3678e3a YW |
8 | unsigned char nh_family; |
9 | unsigned char nh_scope; /* return only */ | |
10 | unsigned char nh_protocol; /* Routing protocol that installed nh */ | |
11 | unsigned char resvd; | |
12 | unsigned int nh_flags; /* RTNH_F flags */ | |
c16c7808 SS |
13 | }; |
14 | ||
15 | /* entry in a nexthop group */ | |
16 | struct nexthop_grp { | |
d3678e3a YW |
17 | __u32 id; /* nexthop id - must exist */ |
18 | __u8 weight; /* weight of this nexthop */ | |
19 | __u8 resvd1; | |
20 | __u16 resvd2; | |
c16c7808 SS |
21 | }; |
22 | ||
23 | enum { | |
d3678e3a YW |
24 | NEXTHOP_GRP_TYPE_MPATH, /* default type if not specified */ |
25 | __NEXTHOP_GRP_TYPE_MAX, | |
c16c7808 SS |
26 | }; |
27 | ||
28 | #define NEXTHOP_GRP_TYPE_MAX (__NEXTHOP_GRP_TYPE_MAX - 1) | |
29 | ||
30 | enum { | |
d3678e3a YW |
31 | NHA_UNSPEC, |
32 | NHA_ID, /* u32; id for nexthop. id == 0 means auto-assign */ | |
c16c7808 | 33 | |
d3678e3a YW |
34 | NHA_GROUP, /* array of nexthop_grp */ |
35 | NHA_GROUP_TYPE, /* u16 one of NEXTHOP_GRP_TYPE */ | |
36 | /* if NHA_GROUP attribute is added, no other attributes can be set */ | |
c16c7808 | 37 | |
d3678e3a YW |
38 | NHA_BLACKHOLE, /* flag; nexthop used to blackhole packets */ |
39 | /* if NHA_BLACKHOLE is added, OIF, GATEWAY, ENCAP can not be set */ | |
c16c7808 | 40 | |
d3678e3a YW |
41 | NHA_OIF, /* u32; nexthop device */ |
42 | NHA_GATEWAY, /* be32 (IPv4) or in6_addr (IPv6) gw address */ | |
43 | NHA_ENCAP_TYPE, /* u16; lwt encap type */ | |
44 | NHA_ENCAP, /* lwt encap data */ | |
c16c7808 | 45 | |
d3678e3a YW |
46 | /* NHA_OIF can be appended to dump request to return only |
47 | * nexthops using given device | |
48 | */ | |
49 | NHA_GROUPS, /* flag; only return nexthop groups in dump */ | |
50 | NHA_MASTER, /* u32; only return nexthops with given master dev */ | |
c16c7808 | 51 | |
ed2c2d36 YW |
52 | NHA_FDB, /* flag; nexthop belongs to a bridge fdb */ |
53 | /* if NHA_FDB is added, OIF, BLACKHOLE, ENCAP cannot be set */ | |
54 | ||
d3678e3a | 55 | __NHA_MAX, |
c16c7808 SS |
56 | }; |
57 | ||
d3678e3a | 58 | #define NHA_MAX (__NHA_MAX - 1) |
c16c7808 | 59 | #endif |