#define BGP_OPT_NO_FIB (1 << 0)
#define BGP_OPT_MULTIPLE_INSTANCE (1 << 1)
#define BGP_OPT_CONFIG_CISCO (1 << 2)
+#define BGP_OPT_NO_LISTEN (1 << 3)
};
/* BGP instance structure. */
#define BGP_FLAG_LOG_NEIGHBOR_CHANGES (1 << 11)
#define BGP_FLAG_GRACEFUL_RESTART (1 << 12)
#define BGP_FLAG_ASPATH_CONFED (1 << 13)
+#define BGP_FLAG_ASPATH_MULTIPATH_RELAX (1 << 14)
/* BGP Per AF flags */
u_int16_t af_flags[AFI_MAX][SAFI_MAX];
/* BGP graceful restart */
u_int32_t restart_time;
u_int32_t stalepath_time;
+
+ /* Maximum-paths configuration */
+ struct bgp_maxpaths_cfg {
+ u_int16_t maxpaths_ebgp;
+ u_int16_t maxpaths_ibgp;
+ } maxpaths[AFI_MAX][SAFI_MAX];
};
/* BGP peer-group support. */
} usmap;
};
+/* IBGP/EBGP identifier. We also have a CONFED peer, which is to say,
+ a peer who's AS is part of our Confederation. */
+typedef enum
+{
+ BGP_PEER_IBGP = 1,
+ BGP_PEER_EBGP,
+ BGP_PEER_INTERNAL,
+ BGP_PEER_CONFED,
+} bgp_peer_sort_t;
+
/* BGP neighbor structure. */
struct peer
{
/* Peer's local AS number. */
as_t local_as;
+ bgp_peer_sort_t sort;
+
/* Peer's Change local AS number. */
as_t change_local_as;
struct stream_fifo *obuf;
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. */
int status;
int ostatus;
/* Peer information */
int fd; /* File descriptor */
int ttl; /* TTL of TCP connection to the peer. */
+ int gtsm_hops; /* minimum hopcount to peer */
char *desc; /* Description of the peer. */
unsigned short port; /* Destination port for peer */
char *host; /* Printable address of the peer. */
#define PEER_FLAG_DYNAMIC_CAPABILITY (1 << 5) /* dynamic capability */
#define PEER_FLAG_DISABLE_CONNECTED_CHECK (1 << 6) /* disable-connected-check */
#define PEER_FLAG_LOCAL_AS_NO_PREPEND (1 << 7) /* local-as no-prepend */
+#define PEER_FLAG_LOCAL_AS_REPLACE_AS (1 << 8) /* local-as no-prepend replace-as */
/* NSF mode (graceful restart) */
u_char nsf[AFI_MAX][SAFI_MAX];
#define BGP_NOTIFY_CAPABILITY_ERR 7
#define BGP_NOTIFY_MAX 8
+#define BGP_NOTIFY_SUBCODE_UNSPECIFIC 0
+
/* BGP_NOTIFY_HEADER_ERR sub codes. */
#define BGP_NOTIFY_HEADER_NOT_SYNC 1
#define BGP_NOTIFY_HEADER_BAD_MESLEN 2
#define BGP_NOTIFY_UPDATE_MAL_AS_PATH 11
#define BGP_NOTIFY_UPDATE_MAX 12
-/* BGP_NOTIFY_CEASE sub codes (draft-ietf-idr-cease-subcode-05). */
+/* BGP_NOTIFY_CEASE sub codes (RFC 4486). */
#define BGP_NOTIFY_CEASE_MAX_PREFIX 1
#define BGP_NOTIFY_CEASE_ADMIN_SHUTDOWN 2
#define BGP_NOTIFY_CEASE_PEER_UNCONFIG 3
#define BGP_DEFAULT_RESTART_TIME 120
#define BGP_DEFAULT_STALEPATH_TIME 360
-/* SAFI which used in open capability negotiation. */
-#define BGP_SAFI_VPNV4 128
-#define BGP_SAFI_VPNV6 129
+/* RFC4364 */
+#define SAFI_MPLS_LABELED_VPN 128
/* Max TTL value. */
#define TTL_MAX 255
/* Check AS path loop when we send NLRI. */
/* #define BGP_SEND_ASPATH_CHECK */
-/* IBGP/EBGP identifier. We also have a CONFED peer, which is to say,
- a peer who's AS is part of our Confederation. */
-enum
-{
- BGP_PEER_IBGP,
- BGP_PEER_EBGP,
- BGP_PEER_INTERNAL,
- BGP_PEER_CONFED
-};
-
/* Flag for peer_clear_soft(). */
enum bgp_clear_type
{
/* Macros. */
#define BGP_INPUT(P) ((P)->ibuf)
#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 */
#define PSIZE(a) (((a) + 7) / (8))
#define BGP_ERR_LOCAL_AS_ALLOWED_ONLY_FOR_EBGP -27
#define BGP_ERR_CANNOT_HAVE_LOCAL_AS_SAME_AS -28
#define BGP_ERR_TCPSIG_FAILED -29
-#define BGP_ERR_MAX -30
+#define BGP_ERR_NO_EBGP_MULTIHOP_WITH_TTLHACK -30
+#define BGP_ERR_NO_IBGP_WITH_TTLHACK -31
+#define BGP_ERR_MAX -32
+#define BGP_ERR_CANNOT_HAVE_LOCAL_AS_SAME_AS_REMOTE_AS -33
extern struct bgp_master *bm;
/* Prototypes. */
extern void bgp_terminate (void);
extern void bgp_reset (void);
+extern time_t bgp_clock (void);
extern void bgp_zclient_reset (void);
extern int bgp_nexthop_set (union sockunion *, union sockunion *,
struct bgp_nexthop *, struct peer *);
int *);
extern struct peer *peer_lock (struct peer *);
extern struct peer *peer_unlock (struct peer *);
-extern int 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_nego (struct peer *);
extern struct peer *peer_create_accept (struct bgp *);
extern int peer_allowas_in_set (struct peer *, afi_t, safi_t, int);
extern int peer_allowas_in_unset (struct peer *, afi_t, safi_t);
-extern int peer_local_as_set (struct peer *, as_t, int);
+extern int peer_local_as_set (struct peer *, as_t, int, int);
extern int peer_local_as_unset (struct peer *);
extern int peer_prefix_list_set (struct peer *, afi_t, safi_t, int, const char *);
extern int peer_clear (struct peer *);
extern int peer_clear_soft (struct peer *, afi_t, safi_t, enum bgp_clear_type);
-extern void peer_nsf_stop (struct peer *);
+extern int peer_ttl_security_hops_set (struct peer *, int);
+extern int peer_ttl_security_hops_unset (struct peer *);
#endif /* _QUAGGA_BGPD_H */