summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_fsm.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2023-08-27 00:07:04 +0200
committerDonald Sharp <sharpd@nvidia.com>2023-09-10 14:31:25 +0200
commitd2ba78929f63d49e78140f28995cc745c1c95966 (patch)
tree71d85bcef551397e7699670cea25fd3744a27a03 /bgpd/bgp_fsm.h
parentbgpd: peer_established should be connection oriented (diff)
downloadfrr-d2ba78929f63d49e78140f28995cc745c1c95966.tar.xz
frr-d2ba78929f63d49e78140f28995cc745c1c95966.zip
bgpd: bgp_fsm_change_status/BGP_TIMER_ON and BGP_EVENT_ADD
Modify bgp_fsm_change_status to be connection oriented and also make the BGP_TIMER_ON and BGP_EVENT_ADD macros connection oriented as well. Attempt to make peer_xfer_conn a bit more understandable because, frankly it was/is confusing. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/bgp_fsm.h')
-rw-r--r--bgpd/bgp_fsm.h38
1 files changed, 20 insertions, 18 deletions
diff --git a/bgpd/bgp_fsm.h b/bgpd/bgp_fsm.h
index 0e2fbb292..7a99623a5 100644
--- a/bgpd/bgp_fsm.h
+++ b/bgpd/bgp_fsm.h
@@ -17,27 +17,28 @@ enum bgp_fsm_state_progress {
/* Macro for BGP read, write and timer thread. */
#define BGP_TIMER_ON(T, F, V) \
do { \
- if ((peer->connection->status != Deleted)) \
- event_add_timer(bm->master, (F), peer, (V), &(T)); \
+ if ((connection->status != Deleted)) \
+ event_add_timer(bm->master, (F), connection, (V), \
+ &(T)); \
} while (0)
-#define BGP_EVENT_ADD(P, E) \
+#define BGP_EVENT_ADD(C, E) \
do { \
- if ((P)->connection->status != Deleted) \
- event_add_event(bm->master, bgp_event, (P), (E), NULL); \
+ if ((C)->status != Deleted) \
+ event_add_event(bm->master, bgp_event, (C), (E), NULL); \
} while (0)
-#define BGP_UPDATE_GROUP_TIMER_ON(T, F) \
- do { \
- if (BGP_SUPPRESS_FIB_ENABLED(peer->bgp) && \
- PEER_ROUTE_ADV_DELAY(peer)) \
- event_add_timer_msec( \
- bm->master, (F), peer, \
- (BGP_DEFAULT_UPDATE_ADVERTISEMENT_TIME * \
- 1000), \
- (T)); \
- else \
- event_add_timer_msec(bm->master, (F), peer, 0, (T)); \
+#define BGP_UPDATE_GROUP_TIMER_ON(T, F) \
+ do { \
+ if (BGP_SUPPRESS_FIB_ENABLED(peer->bgp) && \
+ PEER_ROUTE_ADV_DELAY(peer)) \
+ event_add_timer_msec(bm->master, (F), connection, \
+ (BGP_DEFAULT_UPDATE_ADVERTISEMENT_TIME * \
+ 1000), \
+ (T)); \
+ else \
+ event_add_timer_msec(bm->master, (F), connection, 0, \
+ (T)); \
} while (0)
#define BGP_MSEC_JITTER 10
@@ -107,11 +108,12 @@ enum bgp_fsm_state_progress {
*/
extern void bgp_fsm_nht_update(struct peer *peer, bool has_valid_nexthops);
extern void bgp_event(struct event *event);
-extern int bgp_event_update(struct peer *, enum bgp_fsm_events event);
+extern int bgp_event_update(struct peer_connection *connection,
+ enum bgp_fsm_events event);
extern enum bgp_fsm_state_progress bgp_stop(struct peer_connection *connection);
extern void bgp_timer_set(struct peer_connection *connection);
extern void bgp_routeadv_timer(struct event *event);
-extern void bgp_fsm_change_status(struct peer *peer,
+extern void bgp_fsm_change_status(struct peer_connection *connection,
enum bgp_fsm_status status);
extern const char *const peer_down_str[];
extern void bgp_update_delay_end(struct bgp *);