version 1.1.1.3, 2013/07/21 23:54:39
|
version 1.1.1.4, 2016/11/02 10:09:11
|
Line 27 Software Foundation, Inc., 59 Temple Place - Suite 330
|
Line 27 Software Foundation, Inc., 59 Temple Place - Suite 330
|
|
|
#ifdef SUNOS_5 |
#ifdef SUNOS_5 |
#define _XPG4_2 |
#define _XPG4_2 |
#define __EXTENSIONS__ |
|
typedef unsigned int u_int32_t; |
typedef unsigned int u_int32_t; |
typedef unsigned short u_int16_t; |
typedef unsigned short u_int16_t; |
typedef unsigned char u_int8_t; |
typedef unsigned char u_int8_t; |
Line 40 typedef int socklen_t;
|
Line 39 typedef int socklen_t;
|
#include <unistd.h> |
#include <unistd.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
|
#include <stddef.h> |
#include <ctype.h> |
#include <ctype.h> |
#include <errno.h> |
#include <errno.h> |
#include <fcntl.h> |
#include <fcntl.h> |
Line 50 typedef int socklen_t;
|
Line 50 typedef int socklen_t;
|
#ifdef HAVE_STROPTS_H |
#ifdef HAVE_STROPTS_H |
#include <stropts.h> |
#include <stropts.h> |
#endif /* HAVE_STROPTS_H */ |
#endif /* HAVE_STROPTS_H */ |
#include <sys/fcntl.h> |
|
#ifdef HAVE_SYS_SELECT_H |
#ifdef HAVE_SYS_SELECT_H |
#include <sys/select.h> |
#include <sys/select.h> |
#endif /* HAVE_SYS_SELECT_H */ |
#endif /* HAVE_SYS_SELECT_H */ |
Line 92 typedef int socklen_t;
|
Line 91 typedef int socklen_t;
|
#ifdef HAVE_INTTYPES_H |
#ifdef HAVE_INTTYPES_H |
#include <inttypes.h> |
#include <inttypes.h> |
#endif /* HAVE_INTTYPES_H */ |
#endif /* HAVE_INTTYPES_H */ |
|
#ifdef HAVE_STDBOOL_H |
|
#include <stdbool.h> |
|
#endif |
|
|
/* machine dependent includes */ |
/* machine dependent includes */ |
#ifdef SUNOS_5 |
#ifdef SUNOS_5 |
Line 175 typedef int socklen_t;
|
Line 177 typedef int socklen_t;
|
#include <linux/netlink.h> |
#include <linux/netlink.h> |
#include <linux/rtnetlink.h> |
#include <linux/rtnetlink.h> |
#include <linux/filter.h> |
#include <linux/filter.h> |
#include <stddef.h> |
|
#else |
#else |
#define RT_TABLE_MAIN 0 |
#define RT_TABLE_MAIN 0 |
#endif /* HAVE_NETLINK */ |
#endif /* HAVE_NETLINK */ |
Line 245 typedef int socklen_t;
|
Line 246 typedef int socklen_t;
|
#include <execinfo.h> |
#include <execinfo.h> |
#endif /* HAVE_GLIBC_BACKTRACE */ |
#endif /* HAVE_GLIBC_BACKTRACE */ |
|
|
#ifdef BSDI_NRL |
|
|
|
#ifdef HAVE_NETINET6_IN6_H |
|
#include <netinet6/in6.h> |
|
#endif /* HAVE_NETINET6_IN6_H */ |
|
|
|
#ifdef NRL |
|
#include <netinet6/in6.h> |
|
#endif /* NRL */ |
|
|
|
#define IN6_ARE_ADDR_EQUAL IN6_IS_ADDR_EQUAL |
|
|
|
#endif /* BSDI_NRL */ |
|
|
|
/* Local includes: */ |
/* Local includes: */ |
#if !(defined(__GNUC__) || defined(VTYSH_EXTRACT_PL)) |
#if !(defined(__GNUC__) || defined(VTYSH_EXTRACT_PL)) |
#define __attribute__(x) |
#define __attribute__(x) |
Line 359 struct in_pktinfo
|
Line 346 struct in_pktinfo
|
* OpenBSD: network byte order, apart from older versions which are as per |
* OpenBSD: network byte order, apart from older versions which are as per |
* *BSD |
* *BSD |
*/ |
*/ |
#if defined(__NetBSD__) || defined(__FreeBSD__) \ | #if defined(__NetBSD__) \ |
| || (defined(__FreeBSD__) && (__FreeBSD_version < 1100030)) \ |
|| (defined(__OpenBSD__) && (OpenBSD < 200311)) \ |
|| (defined(__OpenBSD__) && (OpenBSD < 200311)) \ |
|| (defined(__APPLE__)) \ |
|| (defined(__APPLE__)) \ |
|| (defined(SUNOS_5) && defined(WORDS_BIGENDIAN)) |
|| (defined(SUNOS_5) && defined(WORDS_BIGENDIAN)) |
Line 425 struct in_pktinfo
|
Line 413 struct in_pktinfo
|
#define ZEBRA_ROUTER_ID_DELETE 21 |
#define ZEBRA_ROUTER_ID_DELETE 21 |
#define ZEBRA_ROUTER_ID_UPDATE 22 |
#define ZEBRA_ROUTER_ID_UPDATE 22 |
#define ZEBRA_HELLO 23 |
#define ZEBRA_HELLO 23 |
#define ZEBRA_MESSAGE_MAX 24 | #define ZEBRA_IPV4_NEXTHOP_LOOKUP_MRIB 24 |
| #define ZEBRA_VRF_UNREGISTER 25 |
| #define ZEBRA_MESSAGE_MAX 26 |
|
|
/* Marker value used in new Zserv, in the byte location corresponding |
/* Marker value used in new Zserv, in the byte location corresponding |
* the command value in the old zserv header. To allow old and new |
* the command value in the old zserv header. To allow old and new |
Line 455 extern int proto_redistnum(int afi, const char *s);
|
Line 445 extern int proto_redistnum(int afi, const char *s);
|
|
|
extern const char *zserv_command_string (unsigned int command); |
extern const char *zserv_command_string (unsigned int command); |
|
|
/* Zebra's family types. */ |
|
#define ZEBRA_FAMILY_IPV4 1 |
|
#define ZEBRA_FAMILY_IPV6 2 |
|
#define ZEBRA_FAMILY_MAX 3 |
|
|
|
/* Error codes of zebra. */ |
/* Error codes of zebra. */ |
#define ZEBRA_ERR_NOERROR 0 |
#define ZEBRA_ERR_NOERROR 0 |
#define ZEBRA_ERR_RTEXIST -1 |
#define ZEBRA_ERR_RTEXIST -1 |
Line 474 extern const char *zserv_command_string (unsigned int
|
Line 459 extern const char *zserv_command_string (unsigned int
|
#define ZEBRA_FLAG_BLACKHOLE 0x04 |
#define ZEBRA_FLAG_BLACKHOLE 0x04 |
#define ZEBRA_FLAG_IBGP 0x08 |
#define ZEBRA_FLAG_IBGP 0x08 |
#define ZEBRA_FLAG_SELECTED 0x10 |
#define ZEBRA_FLAG_SELECTED 0x10 |
#define ZEBRA_FLAG_CHANGED 0x20 | #define ZEBRA_FLAG_FIB_OVERRIDE 0x20 |
#define ZEBRA_FLAG_STATIC 0x40 |
#define ZEBRA_FLAG_STATIC 0x40 |
#define ZEBRA_FLAG_REJECT 0x80 |
#define ZEBRA_FLAG_REJECT 0x80 |
|
|
Line 494 extern const char *zserv_command_string (unsigned int
|
Line 479 extern const char *zserv_command_string (unsigned int
|
#endif |
#endif |
|
|
/* Address family numbers from RFC1700. */ |
/* Address family numbers from RFC1700. */ |
#define AFI_IP 1 | typedef enum { |
#define AFI_IP6 2 | AFI_IP = 1, |
#define AFI_MAX 3 | AFI_IP6 = 2, |
| #define AFI_MAX 3 |
| } afi_t; |
|
|
/* Subsequent Address Family Identifier. */ |
/* Subsequent Address Family Identifier. */ |
#define SAFI_UNICAST 1 |
#define SAFI_UNICAST 1 |
#define SAFI_MULTICAST 2 |
#define SAFI_MULTICAST 2 |
#define SAFI_RESERVED_3 3 |
#define SAFI_RESERVED_3 3 |
#define SAFI_MPLS_VPN 4 |
#define SAFI_MPLS_VPN 4 |
#define SAFI_MAX 5 | #define SAFI_ENCAP 7 /* per IANA */ |
| #define SAFI_MAX 8 |
|
|
/* Filter direction. */ |
|
#define FILTER_IN 0 |
|
#define FILTER_OUT 1 |
|
#define FILTER_MAX 2 |
|
|
|
/* Default Administrative Distance of each protocol. */ |
/* Default Administrative Distance of each protocol. */ |
#define ZEBRA_KERNEL_DISTANCE_DEFAULT 0 |
#define ZEBRA_KERNEL_DISTANCE_DEFAULT 0 |
#define ZEBRA_CONNECT_DISTANCE_DEFAULT 0 |
#define ZEBRA_CONNECT_DISTANCE_DEFAULT 0 |
Line 527 extern const char *zserv_command_string (unsigned int
|
Line 510 extern const char *zserv_command_string (unsigned int
|
#define SET_FLAG(V,F) (V) |= (F) |
#define SET_FLAG(V,F) (V) |= (F) |
#define UNSET_FLAG(V,F) (V) &= ~(F) |
#define UNSET_FLAG(V,F) (V) &= ~(F) |
|
|
/* AFI and SAFI type. */ |
|
typedef u_int16_t afi_t; |
|
typedef u_int8_t safi_t; |
typedef u_int8_t safi_t; |
|
|
/* Zebra types. Used in Zserv message header. */ |
/* Zebra types. Used in Zserv message header. */ |
typedef u_int16_t zebra_size_t; |
typedef u_int16_t zebra_size_t; |
typedef u_int16_t zebra_command_t; |
typedef u_int16_t zebra_command_t; |
|
|
/* FIFO -- first in first out structure and macros. */ | /* VRF ID type. */ |
struct fifo | typedef u_int16_t vrf_id_t; |
{ | |
struct fifo *next; | |
struct fifo *prev; | |
}; | |
| |
#define FIFO_INIT(F) \ | |
do { \ | |
struct fifo *Xfifo = (struct fifo *)(F); \ | |
Xfifo->next = Xfifo->prev = Xfifo; \ | |
} while (0) | |
| |
#define FIFO_ADD(F,N) \ | |
do { \ | |
struct fifo *Xfifo = (struct fifo *)(F); \ | |
struct fifo *Xnode = (struct fifo *)(N); \ | |
Xnode->next = Xfifo; \ | |
Xnode->prev = Xfifo->prev; \ | |
Xfifo->prev = Xfifo->prev->next = Xnode; \ | |
} while (0) | |
| |
#define FIFO_DEL(N) \ | |
do { \ | |
struct fifo *Xnode = (struct fifo *)(N); \ | |
Xnode->prev->next = Xnode->next; \ | |
Xnode->next->prev = Xnode->prev; \ | |
} while (0) | |
| |
#define FIFO_HEAD(F) \ | |
((((struct fifo *)(F))->next == (struct fifo *)(F)) \ | |
? NULL : (F)->next) | |
| |
#define FIFO_EMPTY(F) \ | |
(((struct fifo *)(F))->next == (struct fifo *)(F)) | |
| |
#define FIFO_TOP(F) \ | |
(FIFO_EMPTY(F) ? NULL : ((struct fifo *)(F))->next) | |
|
|
#endif /* _ZEBRA_H */ |
#endif /* _ZEBRA_H */ |