#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];
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;
#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];
/* 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_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;
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 *);