mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-28 13:20:12 +00:00
include, zebra: Add recent nexthop.h
Add actual recent nexthop.h file from kernel and fix up resulting fallout because FRR's original nexthop.h did not match upstream linux kernel. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
d9654571f9
commit
73b8a68e66
@ -1,12 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
#ifndef _LINUX_NEXTHOP_H
|
||||
#define _LINUX_NEXTHOP_H
|
||||
#ifndef _UAPI_LINUX_NEXTHOP_H
|
||||
#define _UAPI_LINUX_NEXTHOP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define RTM_NHA(h) ((struct rtattr *)(((char *)(h)) + \
|
||||
NLMSG_ALIGN(sizeof(struct nhmsg))))
|
||||
|
||||
struct nhmsg {
|
||||
unsigned char nh_family;
|
||||
unsigned char nh_scope; /* return only */
|
||||
@ -15,6 +12,7 @@ struct nhmsg {
|
||||
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 */
|
||||
@ -23,7 +21,10 @@ struct nexthop_grp {
|
||||
};
|
||||
|
||||
enum {
|
||||
NEXTHOP_GRP_TYPE_MPATH, /* default type if not specified */
|
||||
NEXTHOP_GRP_TYPE_MPATH, /* hash-threshold nexthop group
|
||||
* default type if not specified
|
||||
*/
|
||||
NEXTHOP_GRP_TYPE_RES, /* resilient nexthop group */
|
||||
__NEXTHOP_GRP_TYPE_MAX,
|
||||
};
|
||||
|
||||
@ -50,10 +51,54 @@ enum {
|
||||
*/
|
||||
NHA_GROUPS, /* flag; only return nexthop groups in dump */
|
||||
NHA_MASTER, /* u32; only return nexthops with given master dev */
|
||||
NHA_FDB, /* nexthop belongs to a bridge fdb */
|
||||
|
||||
NHA_FDB, /* flag; nexthop belongs to a bridge fdb */
|
||||
/* if NHA_FDB is added, OIF, BLACKHOLE, ENCAP cannot be set */
|
||||
|
||||
/* nested; resilient nexthop group attributes */
|
||||
NHA_RES_GROUP,
|
||||
/* nested; nexthop bucket attributes */
|
||||
NHA_RES_BUCKET,
|
||||
|
||||
__NHA_MAX,
|
||||
};
|
||||
|
||||
#define NHA_MAX (__NHA_MAX - 1)
|
||||
|
||||
enum {
|
||||
NHA_RES_GROUP_UNSPEC,
|
||||
/* Pad attribute for 64-bit alignment. */
|
||||
NHA_RES_GROUP_PAD = NHA_RES_GROUP_UNSPEC,
|
||||
|
||||
/* u16; number of nexthop buckets in a resilient nexthop group */
|
||||
NHA_RES_GROUP_BUCKETS,
|
||||
/* clock_t as u32; nexthop bucket idle timer (per-group) */
|
||||
NHA_RES_GROUP_IDLE_TIMER,
|
||||
/* clock_t as u32; nexthop unbalanced timer */
|
||||
NHA_RES_GROUP_UNBALANCED_TIMER,
|
||||
/* clock_t as u64; nexthop unbalanced time */
|
||||
NHA_RES_GROUP_UNBALANCED_TIME,
|
||||
|
||||
__NHA_RES_GROUP_MAX,
|
||||
};
|
||||
|
||||
#define NHA_RES_GROUP_MAX (__NHA_RES_GROUP_MAX - 1)
|
||||
|
||||
enum {
|
||||
NHA_RES_BUCKET_UNSPEC,
|
||||
/* Pad attribute for 64-bit alignment. */
|
||||
NHA_RES_BUCKET_PAD = NHA_RES_BUCKET_UNSPEC,
|
||||
|
||||
/* u16; nexthop bucket index */
|
||||
NHA_RES_BUCKET_INDEX,
|
||||
/* clock_t as u64; nexthop bucket idle time */
|
||||
NHA_RES_BUCKET_IDLE_TIME,
|
||||
/* u32; nexthop id assigned to the nexthop bucket */
|
||||
NHA_RES_BUCKET_NH_ID,
|
||||
|
||||
__NHA_RES_BUCKET_MAX,
|
||||
};
|
||||
|
||||
#define NHA_RES_BUCKET_MAX (__NHA_RES_BUCKET_MAX - 1)
|
||||
|
||||
#endif
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "zebra/rt_netlink.h"
|
||||
#include "zebra/kernel_netlink.h"
|
||||
|
||||
const char *nlmsg_type2str(uint16_t type)
|
||||
{
|
||||
|
@ -27,6 +27,10 @@ extern "C" {
|
||||
|
||||
#ifdef HAVE_NETLINK
|
||||
|
||||
#define RTM_NHA(h) \
|
||||
((struct rtattr *)(((char *)(h)) + NLMSG_ALIGN(sizeof(struct nhmsg))))
|
||||
|
||||
|
||||
#define NL_RCV_PKT_BUF_SIZE 32768
|
||||
#define NL_PKT_BUF_SIZE 8192
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user