]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgpd.h
Merge pull request #5248 from opensourcerouting/bgp-sender-as-path-loop-detection
[mirror_frr.git] / bgpd / bgpd.h
index 9e05fd5629d53f2e1ba535f3c0ead97ba4890216..317f200b85cfb62c61adfa5e69e56e08d8f53bf8 100644 (file)
@@ -156,6 +156,9 @@ struct bgp_master {
        /* BGP-EVPN VRF ID. Defaults to default VRF (if any) */
        struct bgp* bgp_evpn;
 
+       /* How big should we set the socket buffer size */
+       uint32_t socket_buffer;
+
        bool terminating;       /* global flag that sigint terminate seen */
        QOBJ_FIELDS
 };
@@ -632,6 +635,8 @@ struct bgp_nexthop {
 #define RMAP_OUT 1
 #define RMAP_MAX 2
 
+#define BGP_DEFAULT_TTL 1
+
 #include "filter.h"
 
 /* BGP filter structure. */
@@ -1152,10 +1157,10 @@ struct peer {
        int rcvd_attr_printed;
 
        /* Prefix count. */
-       unsigned long pcount[AFI_MAX][SAFI_MAX];
+       uint32_t pcount[AFI_MAX][SAFI_MAX];
 
        /* Max prefix count. */
-       unsigned long pmax[AFI_MAX][SAFI_MAX];
+       uint32_t pmax[AFI_MAX][SAFI_MAX];
        uint8_t pmax_threshold[AFI_MAX][SAFI_MAX];
        uint16_t pmax_restart[AFI_MAX][SAFI_MAX];
 #define MAXIMUM_PREFIX_THRESHOLD_DEFAULT 75
@@ -1194,11 +1199,15 @@ struct peer {
 #define PEER_DOWN_BFD_DOWN              24 /* BFD down */
 #define PEER_DOWN_IF_DOWN               25 /* Interface down */
 #define PEER_DOWN_NBR_ADDR_DEL          26 /* Peer address lost */
+#define PEER_DOWN_WAITING_NHT           27 /* Waiting for NHT to resolve */
+#define PEER_DOWN_NBR_ADDR              28 /* Waiting for peer IPv6 IP Addr */
+#define PEER_DOWN_VRF_UNINIT            29 /* Associated VRF is not init yet */
+#define PEER_DOWN_NOAFI_ACTIVATED       30 /* No AFI/SAFI activated for peer */
        size_t last_reset_cause_size;
        uint8_t last_reset_cause[BGP_MAX_PACKET_SIZE];
 
        /* The kind of route-map Flags.*/
-       uint8_t rmap_type;
+       uint16_t rmap_type;
 #define PEER_RMAP_TYPE_IN             (1 << 0) /* neighbor route-map in */
 #define PEER_RMAP_TYPE_OUT            (1 << 1) /* neighbor route-map out */
 #define PEER_RMAP_TYPE_NETWORK        (1 << 2) /* network route-map */
@@ -1207,6 +1216,7 @@ struct peer {
 #define PEER_RMAP_TYPE_NOSET          (1 << 5) /* not allow to set commands */
 #define PEER_RMAP_TYPE_IMPORT         (1 << 6) /* neighbor route-map import */
 #define PEER_RMAP_TYPE_EXPORT         (1 << 7) /* neighbor route-map export */
+#define PEER_RMAP_TYPE_AGGREGATE      (1 << 8) /* aggregate-address route-map */
 
        /* peer specific BFD information */
        struct bfd_info *bfd_info;
@@ -1215,6 +1225,9 @@ struct peer {
        char *hostname;
        char *domainname;
 
+       /* Sender side AS path loop detection. */
+       bool as_path_loop_detection;
+
        QOBJ_FIELDS
 };
 DECLARE_QOBJ_TYPE(peer)
@@ -1437,9 +1450,6 @@ struct bgp_nlri {
 #define BGP_VTY_PORT                          2605
 #define BGP_DEFAULT_CONFIG             "bgpd.conf"
 
-/* Check AS path loop when we send NLRI.  */
-/* #define BGP_SEND_ASPATH_CHECK */
-
 /* BGP Dynamic Neighbors feature */
 #define BGP_DYNAMIC_NEIGHBORS_LIMIT_DEFAULT    100
 #define BGP_DYNAMIC_NEIGHBORS_LIMIT_MIN          1
@@ -1570,7 +1580,8 @@ extern char *peer_uptime(time_t uptime2, char *buf, size_t len, bool use_json,
 
 extern int bgp_config_write(struct vty *);
 
-extern void bgp_master_init(struct thread_master *master);
+extern void bgp_master_init(struct thread_master *master,
+                           const int buffer_size);
 
 extern void bgp_init(unsigned short instance);
 extern void bgp_pthreads_run(void);
@@ -1931,4 +1942,7 @@ extern struct peer *peer_new(struct bgp *bgp);
 extern struct peer *peer_lookup_in_view(struct vty *vty, struct bgp *bgp,
                                        const char *ip_str, bool use_json);
 
+/* Hooks */
+DECLARE_HOOK(peer_status_changed, (struct peer * peer), (peer))
+
 #endif /* _QUAGGA_BGPD_H */