2023-02-08 13:17:09 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Zebra common header.
|
2017-05-13 10:25:29 +02:00
|
|
|
* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Kunihiro Ishiguro
|
|
|
|
*/
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
#ifndef _ZEBRA_H
|
|
|
|
#define _ZEBRA_H
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif /* HAVE_CONFIG_H */
|
|
|
|
|
2018-03-30 21:52:12 +02:00
|
|
|
#include "compiler.h"
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2013-07-30 15:36:26 +02:00
|
|
|
#include <stddef.h>
|
2002-12-13 21:15:29 +01:00
|
|
|
#include <ctype.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#include <string.h>
|
2003-06-04 15:59:38 +02:00
|
|
|
#include <pwd.h>
|
2002-12-13 21:15:29 +01:00
|
|
|
#ifdef HAVE_STROPTS_H
|
|
|
|
#include <stropts.h>
|
|
|
|
#endif /* HAVE_STROPTS_H */
|
|
|
|
#include <sys/select.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/param.h>
|
|
|
|
#ifdef HAVE_SYS_SYSCTL_H
|
2020-01-20 15:40:49 +01:00
|
|
|
#ifdef GNU_LINUX
|
|
|
|
#include <linux/types.h>
|
|
|
|
#else
|
2002-12-13 21:15:29 +01:00
|
|
|
#include <sys/sysctl.h>
|
2019-10-23 15:08:21 +02:00
|
|
|
#endif
|
2002-12-13 21:15:29 +01:00
|
|
|
#endif /* HAVE_SYS_SYSCTL_H */
|
|
|
|
#ifdef HAVE_SYS_CONF_H
|
|
|
|
#include <sys/conf.h>
|
|
|
|
#endif /* HAVE_SYS_CONF_H */
|
|
|
|
#ifdef HAVE_SYS_KSYM_H
|
|
|
|
#include <sys/ksym.h>
|
|
|
|
#endif /* HAVE_SYS_KSYM_H */
|
|
|
|
#include <syslog.h>
|
2016-11-15 05:37:14 +01:00
|
|
|
#include <sys/time.h>
|
|
|
|
#include <time.h>
|
2002-12-13 21:15:29 +01:00
|
|
|
#include <sys/utsname.h>
|
2003-10-22 04:50:45 +02:00
|
|
|
#include <limits.h>
|
2006-05-28 10:08:24 +02:00
|
|
|
#include <inttypes.h>
|
2015-09-15 17:15:27 +02:00
|
|
|
#include <stdbool.h>
|
2021-04-21 12:23:14 +02:00
|
|
|
#ifdef HAVE_SYS_ENDIAN_H
|
|
|
|
#include <sys/endian.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ENDIAN_H
|
|
|
|
#include <endian.h>
|
|
|
|
#endif
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* misc include group */
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
/* network include group */
|
|
|
|
|
|
|
|
#include <sys/socket.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_SYS_SOCKIO_H
|
|
|
|
#include <sys/sockio.h>
|
|
|
|
#endif /* HAVE_SYS_SOCKIO_H */
|
|
|
|
|
2017-08-01 22:04:26 +02:00
|
|
|
#ifndef HAVE_LIBCRYPT
|
|
|
|
#ifdef HAVE_LIBCRYPTO
|
|
|
|
#include <openssl/des.h>
|
|
|
|
# define crypt DES_crypt
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2017-07-11 15:11:21 +02:00
|
|
|
#include "openbsd-tree.h"
|
2017-06-16 23:40:17 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <netinet/ip.h>
|
|
|
|
#include <netinet/tcp.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_NET_NETOPT_H
|
|
|
|
#include <net/netopt.h>
|
|
|
|
#endif /* HAVE_NET_NETOPT_H */
|
|
|
|
|
|
|
|
#include <net/if.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_NET_IF_DL_H
|
|
|
|
#include <net/if_dl.h>
|
|
|
|
#endif /* HAVE_NET_IF_DL_H */
|
|
|
|
|
|
|
|
#ifdef HAVE_NET_IF_VAR_H
|
|
|
|
#include <net/if_var.h>
|
|
|
|
#endif /* HAVE_NET_IF_VAR_H */
|
|
|
|
|
|
|
|
#include <net/route.h>
|
|
|
|
|
2023-11-04 09:15:54 +01:00
|
|
|
#ifndef HAVE_NETLINK
|
2002-12-13 21:15:29 +01:00
|
|
|
#define RT_TABLE_MAIN 0
|
2023-09-14 13:52:25 +02:00
|
|
|
#define RT_TABLE_LOCAL RT_TABLE_MAIN
|
2002-12-13 21:15:29 +01:00
|
|
|
#endif /* HAVE_NETLINK */
|
|
|
|
|
|
|
|
#include <netdb.h>
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_INET_ND_H
|
|
|
|
#include <inet/nd.h>
|
|
|
|
#endif /* HAVE_INET_ND_H */
|
|
|
|
|
|
|
|
#ifdef HAVE_NETINET_IN_VAR_H
|
|
|
|
#include <netinet/in_var.h>
|
|
|
|
#endif /* HAVE_NETINET_IN_VAR_H */
|
|
|
|
|
2003-05-25 23:04:54 +02:00
|
|
|
#ifdef HAVE_NETINET6_IN6_VAR_H
|
|
|
|
#include <netinet6/in6_var.h>
|
|
|
|
#endif /* HAVE_NETINET6_IN6_VAR_H */
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
#ifdef HAVE_NETINET_IN6_VAR_H
|
|
|
|
#include <netinet/in6_var.h>
|
|
|
|
#endif /* HAVE_NETINET_IN6_VAR_H */
|
|
|
|
|
|
|
|
#ifdef HAVE_NETINET6_IN_H
|
|
|
|
#include <netinet6/in.h>
|
|
|
|
#endif /* HAVE_NETINET6_IN_H */
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_NETINET6_IP6_H
|
|
|
|
#include <netinet6/ip6.h>
|
|
|
|
#endif /* HAVE_NETINET6_IP6_H */
|
|
|
|
|
|
|
|
#ifdef HAVE_NETINET6_ND6_H
|
|
|
|
#include <netinet6/nd6.h>
|
|
|
|
#endif /* HAVE_NETINET6_ND6_H */
|
|
|
|
|
2005-03-16 17:13:06 +01:00
|
|
|
/* Local includes: */
|
2022-10-04 18:44:36 +02:00
|
|
|
#if !defined(__GNUC__)
|
2005-03-16 17:13:06 +01:00
|
|
|
#define __attribute__(x)
|
2022-10-04 18:44:36 +02:00
|
|
|
#endif /* !__GNUC__ */
|
2005-03-16 17:13:06 +01:00
|
|
|
|
2021-03-16 10:54:51 +01:00
|
|
|
#include <assert.h>
|
2005-03-16 17:13:06 +01:00
|
|
|
|
2019-02-11 19:04:26 +01:00
|
|
|
/*
|
|
|
|
* Add explicit static cast only when using a C++ compiler.
|
|
|
|
*/
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#define static_cast(l, r) static_cast<decltype(l)>((r))
|
|
|
|
#else
|
|
|
|
#define static_cast(l, r) (r)
|
|
|
|
#endif
|
|
|
|
|
2021-05-21 01:22:14 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2016-11-15 09:15:49 +01:00
|
|
|
#ifndef HAVE_STRLCAT
|
2018-03-14 13:43:17 +01:00
|
|
|
size_t strlcat(char *__restrict dest,
|
|
|
|
const char *__restrict src, size_t destsize);
|
2016-11-15 09:15:49 +01:00
|
|
|
#endif
|
|
|
|
#ifndef HAVE_STRLCPY
|
2018-03-14 13:43:17 +01:00
|
|
|
size_t strlcpy(char *__restrict dest,
|
|
|
|
const char *__restrict src, size_t destsize);
|
2016-11-15 09:15:49 +01:00
|
|
|
#endif
|
2005-03-16 17:13:06 +01:00
|
|
|
|
2022-05-07 19:23:09 +02:00
|
|
|
#ifndef HAVE_EXPLICIT_BZERO
|
|
|
|
void explicit_bzero(void *buf, size_t len);
|
|
|
|
#endif
|
|
|
|
|
2004-06-11 13:27:03 +02:00
|
|
|
/*
|
2004-11-15 19:51:15 +01:00
|
|
|
* RFC 3542 defines several macros for using struct cmsghdr.
|
|
|
|
* Here, we define those that are not present
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Internal defines, for use only in this file.
|
|
|
|
* These are likely wrong on other than ILP32 machines, so warn.
|
2004-06-11 13:27:03 +02:00
|
|
|
*/
|
|
|
|
#ifndef _CMSG_DATA_ALIGN
|
|
|
|
#define _CMSG_DATA_ALIGN(n) (((n) + 3) & ~3)
|
|
|
|
#endif /* _CMSG_DATA_ALIGN */
|
|
|
|
|
|
|
|
#ifndef _CMSG_HDR_ALIGN
|
|
|
|
#define _CMSG_HDR_ALIGN(n) (((n) + 3) & ~3)
|
|
|
|
#endif /* _CMSG_HDR_ALIGN */
|
|
|
|
|
2004-11-15 19:51:15 +01:00
|
|
|
/*
|
|
|
|
* CMSG_SPACE and CMSG_LEN are required in RFC3542, but were new in that
|
|
|
|
* version.
|
|
|
|
*/
|
2004-06-11 13:27:03 +02:00
|
|
|
#ifndef CMSG_SPACE
|
|
|
|
#define CMSG_SPACE(l) \
|
|
|
|
(_CMSG_DATA_ALIGN(sizeof(struct cmsghdr)) + _CMSG_HDR_ALIGN(l))
|
2004-11-15 19:51:15 +01:00
|
|
|
#warning "assuming 4-byte alignment for CMSG_SPACE"
|
2004-06-11 13:27:03 +02:00
|
|
|
#endif /* CMSG_SPACE */
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef CMSG_LEN
|
|
|
|
#define CMSG_LEN(l) (_CMSG_DATA_ALIGN(sizeof(struct cmsghdr)) + (l))
|
2004-11-15 19:51:15 +01:00
|
|
|
#warning "assuming 4-byte alignment for CMSG_LEN"
|
2004-06-11 13:27:03 +02:00
|
|
|
#endif /* CMSG_LEN */
|
|
|
|
|
2004-11-15 19:51:15 +01:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* The definition of struct in_pktinfo is missing in old version of
|
|
|
|
GLIBC 2.1 (Redhat 6.1). */
|
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
|
|
|
#if defined(GNU_LINUX) && !defined(HAVE_STRUCT_IN_PKTINFO)
|
2002-12-13 21:15:29 +01:00
|
|
|
struct in_pktinfo {
|
|
|
|
int ipi_ifindex;
|
|
|
|
struct in_addr ipi_spec_dst;
|
|
|
|
struct in_addr ipi_addr;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2004-09-27 14:46:37 +02:00
|
|
|
/*
|
|
|
|
* IP_HDRINCL / struct ip byte order
|
|
|
|
*
|
|
|
|
* Linux: network byte order
|
|
|
|
* *BSD: network, except for length and offset. (cf Stevens)
|
|
|
|
* SunOS: nominally as per BSD. but bug: network order on LE.
|
|
|
|
* OpenBSD: network byte order, apart from older versions which are as per
|
|
|
|
* *BSD
|
|
|
|
*/
|
2023-11-04 09:30:31 +01:00
|
|
|
#if defined(__NetBSD__) || \
|
|
|
|
(defined(__FreeBSD__) && (__FreeBSD_version < 1100030)) || \
|
|
|
|
(defined(__OpenBSD__) && (OpenBSD < 200311))
|
2004-09-27 14:46:37 +02:00
|
|
|
#define HAVE_IP_HDRINCL_BSD_ORDER
|
|
|
|
#endif
|
|
|
|
|
2021-04-21 12:23:14 +02:00
|
|
|
/* autoconf macros for this are deprecated, just find endian.h */
|
2005-11-03 10:00:23 +01:00
|
|
|
#ifndef BYTE_ORDER
|
2021-04-21 12:23:14 +02:00
|
|
|
#error please locate an endian.h file appropriate to your platform
|
|
|
|
#endif
|
2005-11-03 10:00:23 +01:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* For old definition. */
|
|
|
|
#ifndef IN6_ARE_ADDR_EQUAL
|
|
|
|
#define IN6_ARE_ADDR_EQUAL IN6_IS_ADDR_EQUAL
|
|
|
|
#endif /* IN6_ARE_ADDR_EQUAL */
|
|
|
|
|
2005-05-06 Paul Jakma <paul@dishone.st>
* (general) extern and static'ification of functions in code and
header.
Cleanup any definitions with unspecified arguments.
Add casts for callback assignments where the callback is defined,
typically, as passing void *, but the function being assigned has
some other pointer type defined as its argument, as gcc complains
about casts from void * to X* via function arguments.
Fix some old K&R style function argument definitions.
Add noreturn gcc attribute to some functions, as appropriate.
Add unused gcc attribute to some functions (eg ones meant to help
while debugging)
Add guard defines to headers which were missing them.
* command.c: (install_node) add const qualifier, still doesnt shut
up the warning though, because of the double pointer.
(cmp_node) ditto
* keychain.c: (key_str2time) Add GET_LONG_RANGE() macro, derived
fromn vty.h ones to fix some of the (long) < 0 warnings.
* thread.c: (various) use thread_empty
(cpu_record_hash_key) should cast to uintptr_t, a stdint.h type
* vty.h: Add VTY_GET_IPV4_ADDRESS and VTY_GET_IPV4_PREFIX so they
removed from ospfd/ospf_vty.h
* zebra.h: Move definition of ZEBRA_PORT to here, to remove
dependence of lib on zebra/zserv.h
2005-05-06 23:25:49 +02:00
|
|
|
/* default zebra TCP port for zclient */
|
|
|
|
#define ZEBRA_PORT 2600
|
|
|
|
|
2018-10-03 18:27:57 +02:00
|
|
|
/*
|
|
|
|
* The compiler.h header is used for anyone using the CPP_NOTICE
|
|
|
|
* since this is universally needed, let's add it to zebra.h
|
|
|
|
*/
|
|
|
|
#include "compiler.h"
|
|
|
|
|
2009-09-16 01:52:42 +02:00
|
|
|
/* Zebra route's types are defined in route_types.h */
|
2021-04-21 11:19:39 +02:00
|
|
|
#include "lib/route_types.h"
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2016-11-28 17:46:55 +01:00
|
|
|
#define strmatch(a,b) (!strcmp((a), (b)))
|
|
|
|
|
2022-12-10 01:27:20 +01:00
|
|
|
#if BYTE_ORDER == LITTLE_ENDIAN
|
|
|
|
#define htonll(x) (((uint64_t)htonl((x)&0xFFFFFFFF) << 32) | htonl((x) >> 32))
|
|
|
|
#define ntohll(x) (((uint64_t)ntohl((x)&0xFFFFFFFF) << 32) | ntohl((x) >> 32))
|
|
|
|
#else
|
|
|
|
#define htonll(x) (x)
|
|
|
|
#define ntohll(x) (x)
|
|
|
|
#endif
|
2021-04-01 17:22:40 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
#ifndef INADDR_LOOPBACK
|
|
|
|
#define INADDR_LOOPBACK 0x7f000001 /* Internet address 127.0.0.1. */
|
|
|
|
#endif
|
|
|
|
|
2023-10-10 22:45:57 +02:00
|
|
|
/* Address family numbers from RFC1700. */
|
2019-03-03 02:58:38 +01:00
|
|
|
typedef enum {
|
|
|
|
AFI_UNSPEC = 0,
|
|
|
|
AFI_IP = 1,
|
|
|
|
AFI_IP6 = 2,
|
|
|
|
AFI_L2VPN = 3,
|
2023-10-10 22:45:57 +02:00
|
|
|
AFI_MAX = 4
|
2019-03-03 02:58:38 +01:00
|
|
|
} afi_t;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2020-01-03 23:48:36 +01:00
|
|
|
#define IS_VALID_AFI(a) ((a) > AFI_UNSPEC && (a) < AFI_MAX)
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Subsequent Address Family Identifier. */
|
2017-08-01 02:06:40 +02:00
|
|
|
typedef enum {
|
2019-08-12 21:02:39 +02:00
|
|
|
SAFI_UNSPEC = 0,
|
2017-08-01 02:06:40 +02:00
|
|
|
SAFI_UNICAST = 1,
|
|
|
|
SAFI_MULTICAST = 2,
|
|
|
|
SAFI_MPLS_VPN = 3,
|
|
|
|
SAFI_ENCAP = 4,
|
|
|
|
SAFI_EVPN = 5,
|
|
|
|
SAFI_LABELED_UNICAST = 6,
|
2018-03-05 18:09:57 +01:00
|
|
|
SAFI_FLOWSPEC = 7,
|
2023-10-10 22:45:57 +02:00
|
|
|
SAFI_MAX = 8
|
2017-08-01 02:06:40 +02:00
|
|
|
} safi_t;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2020-11-15 00:50:37 +01:00
|
|
|
#define FOREACH_AFI_SAFI(afi, safi) \
|
|
|
|
for (afi = AFI_IP; afi < AFI_MAX; afi++) \
|
|
|
|
for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++)
|
|
|
|
|
2022-01-12 21:43:52 +01:00
|
|
|
#define FOREACH_AFI_SAFI_NSF(afi, safi) \
|
|
|
|
for (afi = AFI_IP; afi < AFI_MAX; afi++) \
|
|
|
|
for (safi = SAFI_UNICAST; safi <= SAFI_MPLS_VPN; safi++)
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Flag manipulation macros. */
|
|
|
|
#define CHECK_FLAG(V,F) ((V) & (F))
|
2005-02-08 16:57:25 +01:00
|
|
|
#define SET_FLAG(V,F) (V) |= (F)
|
|
|
|
#define UNSET_FLAG(V,F) (V) &= ~(F)
|
2015-05-20 02:40:34 +02:00
|
|
|
#define RESET_FLAG(V) (V) = 0
|
bgpd: Implement group-overrides for peer flags
The current implementation of peer flags (e.g. shutdown, passive, ...)
only has partial support for overriding flags of a peer-group when the
peer is a member. Often settings might get lost if the user toys around
with the peer-group configuration, which can lead to disaster.
This commit introduces the same override implementation which was
previously integrated to support proper peer flag/attribute override on
the address-family level. The code is very similar and the global
attributes now use their separate state-arrays *flags_invert* and
*flags_override*.
The test suite for BGP peer attributes was extended to also check peer
global attributes, so that the newly introduced changes are covered. An
additional feature was added which allows to test an attribute with an
*interface-peer*, which can be configured by running `neighbor IF-TEST
interface`. This was introduced so that the dynamic runtime inversion of
the `extended-nexthop` flag, which is only enabled by default for
interface peers, can also be tested.
Last but not least, two small changes have been made to the current bgpd
implementation:
- The command `strict-capability-match` can now also be set on a
peer-group, it seems like this command slipped through while
implementing peer-groups in the very past.
- The macro `COND_FLAG` was introduced inside lib/zebra.h, which now
allows to either set or unset a flag based on a condition. The syntax
for using this macro is: `COND_FLAG(flag_variable, flag, condition)`
Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-06-11 19:49:20 +02:00
|
|
|
#define COND_FLAG(V, F, C) ((C) ? (SET_FLAG(V, F)) : (UNSET_FLAG(V, F)))
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2018-02-28 22:11:42 +01:00
|
|
|
/* Atomic flag manipulation macros. */
|
|
|
|
#define CHECK_FLAG_ATOMIC(PV, F) \
|
|
|
|
((atomic_load_explicit(PV, memory_order_seq_cst)) & (F))
|
|
|
|
#define SET_FLAG_ATOMIC(PV, F) \
|
|
|
|
((atomic_fetch_or_explicit(PV, (F), memory_order_seq_cst)))
|
|
|
|
#define UNSET_FLAG_ATOMIC(PV, F) \
|
|
|
|
((atomic_fetch_and_explicit(PV, ~(F), memory_order_seq_cst)))
|
|
|
|
#define RESET_FLAG_ATOMIC(PV) \
|
|
|
|
((atomic_store_explicit(PV, 0, memory_order_seq_cst)))
|
|
|
|
|
2015-05-22 11:39:56 +02:00
|
|
|
/* VRF ID type. */
|
lib: increase vrf_id from 16 bit to 32 bit identifier
This is a preparatory work for configuring vrf/frr over netns
vrf structure is being changed to 32 bit, and the VRF will have the
possibility to have a backend made up of NETNS.
Let's put some history.
Initially the 32 bit was because one wanted to map on vrf_id both the
VRFLITE and the NSID.
Initially, one would have liked to make zebra configure at the same time
both vrf lite and vrf from netns in a flat way. From the show
running perspective, one would have had both kind of vrfs, thatone
would configure on the same way.
however, it leads to inconsistencies in concepts, because it mixes vrf
vrf with vrf, and vrf is not always mapped with netns.
For instance, logical-router could also be used with netns. In that
case, it would not be possible to map vrf with netns.
There was an other reason why 32 bit is proposed. this is because
some systems handle NSID to 32 bits. As vrf lite exists only on
Linux, there are other systems that would like to use an other vrf
backend than vrf lite. The netns backend for vrf will be used for that
too. for instance, for windows or freebsd, some similar
netns concept exists; so it will be easier to reuse netns
backend for vrf, than reusing vrflite backend for vrf.
This commit is here to extend vrf_id to 32 bits. Following commits in a
second step will help in enable a VRF backend.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2017-12-14 16:01:36 +01:00
|
|
|
typedef uint32_t vrf_id_t;
|
2015-05-22 11:39:56 +02:00
|
|
|
|
2016-10-01 20:42:34 +02:00
|
|
|
typedef uint32_t route_tag_t;
|
|
|
|
#define ROUTE_TAG_MAX UINT32_MAX
|
|
|
|
#define ROUTE_TAG_PRI PRIu32
|
|
|
|
|
2021-05-21 01:22:14 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
#endif /* _ZEBRA_H */
|