summaryrefslogtreecommitdiff
path: root/proto/bgp/bgp.h
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2023-02-05 19:54:06 +0100
committerMaria Matejka <mq@ucw.cz>2023-02-07 11:52:03 +0100
commit0bb04d5390f21b0c96fc4894ba5d5510c541f0ef (patch)
treea9edefc851544e550771aa23090890d9de85729c /proto/bgp/bgp.h
parent597a4b33a700773032038051abc4f9f5e92942bd (diff)
BGP: opening and closing listening socket asynchronously
Diffstat (limited to 'proto/bgp/bgp.h')
-rw-r--r--proto/bgp/bgp.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/proto/bgp/bgp.h b/proto/bgp/bgp.h
index 2808d479..5f1a35ce 100644
--- a/proto/bgp/bgp.h
+++ b/proto/bgp/bgp.h
@@ -266,8 +266,8 @@ struct bgp_caps {
struct bgp_socket {
node n; /* Node in global bgp_sockets */
+ list requests; /* Listen requests */
sock *sk; /* Real listening socket */
- u32 uc; /* Use count */
};
struct bgp_stats {
@@ -302,6 +302,16 @@ struct bgp_conn {
uint hold_time, keepalive_time; /* Times calculated from my and neighbor's requirements */
};
+struct bgp_listen_request {
+ node n; /* Node in bgp_socket / pending list */
+ struct bgp_socket *sock; /* Assigned socket */
+ ip_addr addr;
+ struct iface *iface;
+ struct iface *vrf;
+ uint port;
+ uint flags;
+};
+
struct bgp_proto {
struct proto p;
const struct bgp_config *cf; /* Shortcut to BGP configuration */
@@ -333,7 +343,7 @@ struct bgp_proto {
struct bgp_conn incoming_conn; /* Incoming connection we have neither accepted nor rejected yet */
struct object_lock *lock; /* Lock for neighbor connection */
struct neighbor *neigh; /* Neighbor entry corresponding to remote ip, NULL if multihop */
- struct bgp_socket *sock; /* Shared listening socket */
+ struct bgp_listen_request listen; /* Shared listening socket */
struct bfd_request *bfd_req; /* BFD request, if BFD is used */
struct birdsock *postponed_sk; /* Postponed incoming socket for dynamic BGP */
struct bgp_stats stats; /* BGP statistics */