version 1.1.1.3, 2013/07/21 23:54:38
|
version 1.1.1.4, 2016/11/02 10:09:10
|
Line 104 struct bgp
|
Line 104 struct bgp
|
as_t *confed_peers; |
as_t *confed_peers; |
int confed_peers_cnt; |
int confed_peers_cnt; |
|
|
|
struct thread *t_startup; |
|
|
/* BGP flags. */ |
/* BGP flags. */ |
u_int16_t flags; |
u_int16_t flags; |
#define BGP_FLAG_ALWAYS_COMPARE_MED (1 << 0) |
#define BGP_FLAG_ALWAYS_COMPARE_MED (1 << 0) |
Line 120 struct bgp
|
Line 122 struct bgp
|
#define BGP_FLAG_LOG_NEIGHBOR_CHANGES (1 << 11) |
#define BGP_FLAG_LOG_NEIGHBOR_CHANGES (1 << 11) |
#define BGP_FLAG_GRACEFUL_RESTART (1 << 12) |
#define BGP_FLAG_GRACEFUL_RESTART (1 << 12) |
#define BGP_FLAG_ASPATH_CONFED (1 << 13) |
#define BGP_FLAG_ASPATH_CONFED (1 << 13) |
|
#define BGP_FLAG_ASPATH_MULTIPATH_RELAX (1 << 14) |
|
#define BGP_FLAG_DELETING (1 << 15) |
|
|
/* BGP Per AF flags */ |
/* BGP Per AF flags */ |
u_int16_t af_flags[AFI_MAX][SAFI_MAX]; |
u_int16_t af_flags[AFI_MAX][SAFI_MAX]; |
Line 201 struct bgp_nexthop
|
Line 205 struct bgp_nexthop
|
{ |
{ |
struct interface *ifp; |
struct interface *ifp; |
struct in_addr v4; |
struct in_addr v4; |
#ifdef HAVE_IPV6 |
|
struct in6_addr v6_global; |
struct in6_addr v6_global; |
struct in6_addr v6_local; |
struct in6_addr v6_local; |
#endif /* HAVE_IPV6 */ |
|
}; |
}; |
|
|
/* BGP router distinguisher value. */ |
/* BGP router distinguisher value. */ |
Line 312 struct peer
|
Line 314 struct peer
|
struct stream_fifo *obuf; |
struct stream_fifo *obuf; |
struct stream *work; |
struct stream *work; |
|
|
|
/* We use a separate stream to encode MP_REACH_NLRI for efficient |
|
* NLRI packing. peer->work stores all the other attributes. The |
|
* actual packet is then constructed by concatenating the two. |
|
*/ |
|
struct stream *scratch; |
|
|
/* Status of the peer. */ |
/* Status of the peer. */ |
int status; |
int status; |
int ostatus; |
int ostatus; |
Line 322 struct peer
|
Line 330 struct peer
|
/* Peer information */ |
/* Peer information */ |
int fd; /* File descriptor */ |
int fd; /* File descriptor */ |
int ttl; /* TTL of TCP connection to the peer. */ |
int ttl; /* TTL of TCP connection to the peer. */ |
|
int rtt; /* Estimated round-trip-time from TCP_INFO */ |
int gtsm_hops; /* minimum hopcount to peer */ |
int gtsm_hops; /* minimum hopcount to peer */ |
char *desc; /* Description of the peer. */ |
char *desc; /* Description of the peer. */ |
unsigned short port; /* Destination port for peer */ |
unsigned short port; /* Destination port for peer */ |
Line 331 struct peer
|
Line 340 struct peer
|
time_t readtime; /* Last read time */ |
time_t readtime; /* Last read time */ |
time_t resettime; /* Last reset time */ |
time_t resettime; /* Last reset time */ |
|
|
unsigned int ifindex; /* ifindex of the BGP connection. */ | ifindex_t ifindex; /* ifindex of the BGP connection. */ |
char *ifname; /* bind interface name. */ |
char *ifname; /* bind interface name. */ |
char *update_if; |
char *update_if; |
union sockunion *update_source; |
union sockunion *update_source; |
Line 359 struct peer
|
Line 368 struct peer
|
#define PEER_CAP_RESTART_RCV (1 << 6) /* restart received */ |
#define PEER_CAP_RESTART_RCV (1 << 6) /* restart received */ |
#define PEER_CAP_AS4_ADV (1 << 7) /* as4 advertised */ |
#define PEER_CAP_AS4_ADV (1 << 7) /* as4 advertised */ |
#define PEER_CAP_AS4_RCV (1 << 8) /* as4 received */ |
#define PEER_CAP_AS4_RCV (1 << 8) /* as4 received */ |
|
#define PEER_CAP_RESTART_BIT_ADV (1 << 9) /* sent restart state */ |
|
#define PEER_CAP_RESTART_BIT_RCV (1 << 10) /* peer restart state */ |
|
|
/* Capability flags (reset in bgp_stop) */ |
/* Capability flags (reset in bgp_stop) */ |
u_int16_t af_cap[AFI_MAX][SAFI_MAX]; |
u_int16_t af_cap[AFI_MAX][SAFI_MAX]; |
Line 405 struct peer
|
Line 416 struct peer
|
#define PEER_FLAG_MAX_PREFIX (1 << 14) /* maximum prefix */ |
#define PEER_FLAG_MAX_PREFIX (1 << 14) /* maximum prefix */ |
#define PEER_FLAG_MAX_PREFIX_WARNING (1 << 15) /* maximum prefix warning-only */ |
#define PEER_FLAG_MAX_PREFIX_WARNING (1 << 15) /* maximum prefix warning-only */ |
#define PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED (1 << 16) /* leave link-local nexthop unchanged */ |
#define PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED (1 << 16) /* leave link-local nexthop unchanged */ |
|
#define PEER_FLAG_NEXTHOP_SELF_ALL (1 << 17) /* next-hop-self all */ |
|
|
/* MD5 password */ |
/* MD5 password */ |
char *password; |
char *password; |
Line 453 struct peer
|
Line 465 struct peer
|
u_int32_t v_connect; |
u_int32_t v_connect; |
u_int32_t v_holdtime; |
u_int32_t v_holdtime; |
u_int32_t v_keepalive; |
u_int32_t v_keepalive; |
u_int32_t v_asorig; |
|
u_int32_t v_routeadv; |
u_int32_t v_routeadv; |
u_int32_t v_pmax_restart; |
u_int32_t v_pmax_restart; |
u_int32_t v_gr_restart; |
u_int32_t v_gr_restart; |
Line 465 struct peer
|
Line 476 struct peer
|
struct thread *t_connect; |
struct thread *t_connect; |
struct thread *t_holdtime; |
struct thread *t_holdtime; |
struct thread *t_keepalive; |
struct thread *t_keepalive; |
struct thread *t_asorig; |
|
struct thread *t_routeadv; |
struct thread *t_routeadv; |
struct thread *t_pmax_restart; |
struct thread *t_pmax_restart; |
struct thread *t_gr_restart; |
struct thread *t_gr_restart; |
Line 636 struct bgp_nlri
|
Line 646 struct bgp_nlri
|
#define BGP_ATTR_AS4_PATH 17 |
#define BGP_ATTR_AS4_PATH 17 |
#define BGP_ATTR_AS4_AGGREGATOR 18 |
#define BGP_ATTR_AS4_AGGREGATOR 18 |
#define BGP_ATTR_AS_PATHLIMIT 21 |
#define BGP_ATTR_AS_PATHLIMIT 21 |
|
#define BGP_ATTR_ENCAP 23 |
|
|
/* BGP update origin. */ |
/* BGP update origin. */ |
#define BGP_ORIGIN_IGP 0 |
#define BGP_ORIGIN_IGP 0 |
Line 661 struct bgp_nlri
|
Line 672 struct bgp_nlri
|
#define BGP_NOTIFY_HEADER_MAX 4 |
#define BGP_NOTIFY_HEADER_MAX 4 |
|
|
/* BGP_NOTIFY_OPEN_ERR sub codes. */ |
/* BGP_NOTIFY_OPEN_ERR sub codes. */ |
|
#define BGP_NOTIFY_OPEN_UNSPECIFIC 0 |
#define BGP_NOTIFY_OPEN_UNSUP_VERSION 1 |
#define BGP_NOTIFY_OPEN_UNSUP_VERSION 1 |
#define BGP_NOTIFY_OPEN_BAD_PEER_AS 2 |
#define BGP_NOTIFY_OPEN_BAD_PEER_AS 2 |
#define BGP_NOTIFY_OPEN_BAD_BGP_IDENT 3 |
#define BGP_NOTIFY_OPEN_BAD_BGP_IDENT 3 |
Line 731 struct bgp_nlri
|
Line 743 struct bgp_nlri
|
|
|
/* BGP timers default value. */ |
/* BGP timers default value. */ |
#define BGP_INIT_START_TIMER 5 |
#define BGP_INIT_START_TIMER 5 |
#define BGP_ERROR_START_TIMER 30 |
|
#define BGP_DEFAULT_HOLDTIME 180 |
#define BGP_DEFAULT_HOLDTIME 180 |
#define BGP_DEFAULT_KEEPALIVE 60 |
#define BGP_DEFAULT_KEEPALIVE 60 |
#define BGP_DEFAULT_ASORIGINATE 15 |
|
#define BGP_DEFAULT_EBGP_ROUTEADV 30 |
#define BGP_DEFAULT_EBGP_ROUTEADV 30 |
#define BGP_DEFAULT_IBGP_ROUTEADV 5 |
#define BGP_DEFAULT_IBGP_ROUTEADV 5 |
#define BGP_CLEAR_CONNECT_RETRY 20 |
#define BGP_CLEAR_CONNECT_RETRY 20 |
#define BGP_DEFAULT_CONNECT_RETRY 120 | #define BGP_DEFAULT_CONNECT_RETRY 10 |
|
|
/* BGP default local preference. */ |
/* BGP default local preference. */ |
#define BGP_DEFAULT_LOCAL_PREF 100 |
#define BGP_DEFAULT_LOCAL_PREF 100 |
Line 777 enum bgp_clear_type
|
Line 787 enum bgp_clear_type
|
/* Macros. */ |
/* Macros. */ |
#define BGP_INPUT(P) ((P)->ibuf) |
#define BGP_INPUT(P) ((P)->ibuf) |
#define BGP_INPUT_PNT(P) (STREAM_PNT(BGP_INPUT(P))) |
#define BGP_INPUT_PNT(P) (STREAM_PNT(BGP_INPUT(P))) |
|
#define BGP_IS_VALID_STATE_FOR_NOTIF(S)\ |
|
(((S) == OpenSent) || ((S) == OpenConfirm) || ((S) == Established)) |
|
|
/* Count prefix size from mask length */ |
/* Count prefix size from mask length */ |
#define PSIZE(a) (((a) + 7) / (8)) |
#define PSIZE(a) (((a) + 7) / (8)) |
Line 819 enum bgp_clear_type
|
Line 831 enum bgp_clear_type
|
|
|
extern struct bgp_master *bm; |
extern struct bgp_master *bm; |
|
|
extern struct thread_master *master; |
|
|
|
/* Prototypes. */ |
/* Prototypes. */ |
extern void bgp_terminate (void); |
extern void bgp_terminate (void); |
extern void bgp_reset (void); |
extern void bgp_reset (void); |
Line 836 extern struct peer_group *peer_group_lookup (struct bg
|
Line 846 extern struct peer_group *peer_group_lookup (struct bg
|
extern struct peer_group *peer_group_get (struct bgp *, const char *); |
extern struct peer_group *peer_group_get (struct bgp *, const char *); |
extern struct peer *peer_lookup_with_open (union sockunion *, as_t, struct in_addr *, |
extern struct peer *peer_lookup_with_open (union sockunion *, as_t, struct in_addr *, |
int *); |
int *); |
extern struct peer *peer_lock (struct peer *); | |
extern struct peer *peer_unlock (struct peer *); | /* |
| * Peers are incredibly easy to memory leak |
| * due to the various ways that they are actually used |
| * Provide some functionality to debug locks and unlocks |
| */ |
| extern struct peer *peer_lock_with_caller(const char *, struct peer *); |
| extern struct peer *peer_unlock_with_caller(const char *, struct peer *); |
| #define peer_unlock(A) peer_unlock_with_caller(__FUNCTION__, (A)) |
| #define peer_lock(B) peer_lock_with_caller(__FUNCTION__, (B)) |
| |
extern bgp_peer_sort_t peer_sort (struct peer *peer); |
extern bgp_peer_sort_t peer_sort (struct peer *peer); |
extern int peer_active (struct peer *); |
extern int peer_active (struct peer *); |
extern int peer_active_nego (struct peer *); |
extern int peer_active_nego (struct peer *); |
Line 845 extern struct peer *peer_create_accept (struct bgp *);
|
Line 864 extern struct peer *peer_create_accept (struct bgp *);
|
extern char *peer_uptime (time_t, char *, size_t); |
extern char *peer_uptime (time_t, char *, size_t); |
extern int bgp_config_write (struct vty *); |
extern int bgp_config_write (struct vty *); |
extern void bgp_config_write_family_header (struct vty *, afi_t, safi_t, int *); |
extern void bgp_config_write_family_header (struct vty *, afi_t, safi_t, int *); |
| |
extern void bgp_master_init (void); |
extern void bgp_master_init (void); |
|
|
extern void bgp_init (void); |
extern void bgp_init (void); |