]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgpd.h
Merge branch 'quagga' into google-bgp-multipath
[mirror_frr.git] / bgpd / bgpd.h
index e04575d80a18bec5c566c0f48df0a6c4468cf165..09a3435c3bfbe9cc3f0d710161bf2becf26cc6be 100644 (file)
@@ -42,9 +42,15 @@ struct bgp_master
   struct work_queue *process_main_queue;
   struct work_queue *process_rsclient_queue;
   
+  /* Listening sockets */
+  struct list *listen_sockets;
+  
   /* BGP port number.  */
   u_int16_t port;
 
+  /* Listener address */
+  char *address;
+
   /* BGP start time.  */
   time_t start_time;
 
@@ -64,6 +70,9 @@ struct bgp
   /* Name of this BGP instance.  */
   char *name;
   
+  /* Reference count to allow peer_delete to finish after bgp_delete */
+  int lock;
+
   /* Self peer.  */
   struct peer *peer_self;
 
@@ -153,6 +162,12 @@ struct bgp
   /* 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. */
@@ -294,6 +309,7 @@ struct peer
   /* 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. */
@@ -374,7 +390,10 @@ struct peer
 #define PEER_FLAG_ORF_PREFIX_RM             (1 << 13) /* orf capability receive-mode */
 #define PEER_FLAG_MAX_PREFIX                (1 << 14) /* maximum prefix */
 #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 */
+
+  /* MD5 password */
+  char *password;
 
   /* default-originate route-map.  */
   struct
@@ -531,6 +550,9 @@ struct peer
 #define PEER_RMAP_TYPE_EXPORT         (1 << 7) /* neighbor route-map export */
 };
 
+#define PEER_PASSWORD_MINLEN   (1)
+#define PEER_PASSWORD_MAXLEN   (80)
+
 /* This structure's member directly points incoming packet data
    stream. */
 struct bgp_nlri
@@ -616,6 +638,8 @@ struct bgp_nlri
 #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
@@ -646,7 +670,7 @@ struct bgp_nlri
 #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
@@ -709,9 +733,8 @@ struct bgp_nlri
 #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
@@ -784,7 +807,10 @@ enum bgp_clear_type
 #define BGP_ERR_INSTANCE_MISMATCH               -26
 #define BGP_ERR_LOCAL_AS_ALLOWED_ONLY_FOR_EBGP  -27
 #define BGP_ERR_CANNOT_HAVE_LOCAL_AS_SAME_AS    -28
-#define BGP_ERR_MAX                             -29
+#define BGP_ERR_TCPSIG_FAILED                  -29
+#define BGP_ERR_NO_EBGP_MULTIHOP_WITH_TTLHACK  -30
+#define BGP_ERR_NO_IBGP_WITH_TTLHACK           -31
+#define BGP_ERR_MAX                            -32
 
 extern struct bgp_master *bm;
 
@@ -793,6 +819,7 @@ extern struct thread_master *master;
 /* 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 *);
@@ -830,6 +857,9 @@ extern int bgp_flag_set (struct bgp *, int);
 extern int bgp_flag_unset (struct bgp *, int);
 extern int bgp_flag_check (struct bgp *, int);
 
+extern void bgp_lock (struct bgp *);
+extern void bgp_unlock (struct bgp *);
+
 extern int bgp_router_id_set (struct bgp *, struct in_addr *);
 
 extern int bgp_cluster_id_set (struct bgp *, struct in_addr *);
@@ -921,6 +951,10 @@ extern int peer_route_map_set (struct peer *, afi_t, safi_t, int, const char *);
 extern int peer_route_map_unset (struct peer *, afi_t, safi_t, int);
 
 extern int peer_unsuppress_map_set (struct peer *, afi_t, safi_t, const char *);
+
+extern int peer_password_set (struct peer *, const char *);
+extern int peer_password_unset (struct peer *);
+
 extern int peer_unsuppress_map_unset (struct peer *, afi_t, safi_t);
 
 extern int peer_maximum_prefix_set (struct peer *, afi_t, safi_t, u_int32_t, u_char, int, u_int16_t);
@@ -929,6 +963,7 @@ extern int peer_maximum_prefix_unset (struct peer *, afi_t, safi_t);
 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 */