diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-05-12 03:54:18 +0000 | 
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-11-30 16:17:59 -0500 | 
| commit | b72b6f4fc9bd2d969634a5c5237bc16bd1bbe558 (patch) | |
| tree | 6a3290e051ef89e0d1c73bf9cd71f31f931fa032 | |
| parent | 424ab01d0f69a71b865e5f2d817baea7ce263e44 (diff) | |
bgpd: rename peer_keepalives* --> bgp_keepalives*
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
| -rw-r--r-- | bgpd/bgp_fsm.c | 20 | ||||
| -rw-r--r-- | bgpd/bgp_keepalives.c | 22 | ||||
| -rw-r--r-- | bgpd/bgp_keepalives.h | 18 | ||||
| -rw-r--r-- | bgpd/bgpd.c | 4 | 
4 files changed, 32 insertions, 32 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 18262e6e94..0c0c29b740 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -285,7 +285,7 @@ void bgp_timer_set(struct peer *peer)  		}  		BGP_TIMER_OFF(peer->t_connect);  		BGP_TIMER_OFF(peer->t_holdtime); -		peer_keepalives_off(peer); +		bgp_keepalives_off(peer);  		BGP_TIMER_OFF(peer->t_routeadv);  		break; @@ -297,7 +297,7 @@ void bgp_timer_set(struct peer *peer)  		BGP_TIMER_ON(peer->t_connect, bgp_connect_timer,  			     peer->v_connect);  		BGP_TIMER_OFF(peer->t_holdtime); -		peer_keepalives_off(peer); +		bgp_keepalives_off(peer);  		BGP_TIMER_OFF(peer->t_routeadv);  		break; @@ -314,7 +314,7 @@ void bgp_timer_set(struct peer *peer)  				     peer->v_connect);  		}  		BGP_TIMER_OFF(peer->t_holdtime); -		peer_keepalives_off(peer); +		bgp_keepalives_off(peer);  		BGP_TIMER_OFF(peer->t_routeadv);  		break; @@ -328,7 +328,7 @@ void bgp_timer_set(struct peer *peer)  		} else {  			BGP_TIMER_OFF(peer->t_holdtime);  		} -		peer_keepalives_off(peer); +		bgp_keepalives_off(peer);  		BGP_TIMER_OFF(peer->t_routeadv);  		break; @@ -341,11 +341,11 @@ void bgp_timer_set(struct peer *peer)  		   timer and KeepAlive timers are not started. */  		if (peer->v_holdtime == 0) {  			BGP_TIMER_OFF(peer->t_holdtime); -			peer_keepalives_off(peer); +			bgp_keepalives_off(peer);  		} else {  			BGP_TIMER_ON(peer->t_holdtime, bgp_holdtime_timer,  				     peer->v_holdtime); -			peer_keepalives_on(peer); +			bgp_keepalives_on(peer);  		}  		BGP_TIMER_OFF(peer->t_routeadv);  		break; @@ -360,11 +360,11 @@ void bgp_timer_set(struct peer *peer)  		   and keepalive must be turned off. */  		if (peer->v_holdtime == 0) {  			BGP_TIMER_OFF(peer->t_holdtime); -			peer_keepalives_off(peer); +			bgp_keepalives_off(peer);  		} else {  			BGP_TIMER_ON(peer->t_holdtime, bgp_holdtime_timer,  				     peer->v_holdtime); -			peer_keepalives_on(peer); +			bgp_keepalives_on(peer);  		}  		break;  	case Deleted: @@ -376,7 +376,7 @@ void bgp_timer_set(struct peer *peer)  		BGP_TIMER_OFF(peer->t_start);  		BGP_TIMER_OFF(peer->t_connect);  		BGP_TIMER_OFF(peer->t_holdtime); -		peer_keepalives_off(peer); +		bgp_keepalives_off(peer);  		BGP_TIMER_OFF(peer->t_routeadv);  		break;  	} @@ -1065,7 +1065,7 @@ int bgp_stop(struct peer *peer)  	}  	/* stop keepalives */ -	peer_keepalives_off(peer); +	bgp_keepalives_off(peer);  	/* Stop read and write threads. */  	bgp_writes_off(peer); diff --git a/bgpd/bgp_keepalives.c b/bgpd/bgp_keepalives.c index c7383ae77f..dc21f197c9 100644 --- a/bgpd/bgp_keepalives.c +++ b/bgpd/bgp_keepalives.c @@ -142,7 +142,7 @@ static unsigned int peer_hash_key(void *arg)  	return (uintptr_t)pkat->peer;  } -void peer_keepalives_init() +void bgp_keepalives_init()  {  	peerhash_mtx = XCALLOC(MTYPE_TMP, sizeof(pthread_mutex_t));  	peerhash_cond = XCALLOC(MTYPE_TMP, sizeof(pthread_cond_t)); @@ -161,7 +161,7 @@ void peer_keepalives_init()  	peerhash = hash_create_size(2048, peer_hash_key, peer_hash_cmp);  } -static void peer_keepalives_finish(void *arg) +static void bgp_keepalives_finish(void *arg)  {  	bgp_keepalives_thread_run = false; @@ -183,9 +183,9 @@ static void peer_keepalives_finish(void *arg)  /**   * Entry function for peer keepalive generation pthread.   * - * peer_keepalives_init() must be called prior to this. + * bgp_keepalives_init() must be called prior to this.   */ -void *peer_keepalives_start(void *arg) +void *bgp_keepalives_start(void *arg)  {  	struct timeval currtime = {0, 0};  	struct timeval aftertime = {0, 0}; @@ -195,7 +195,7 @@ void *peer_keepalives_start(void *arg)  	pthread_mutex_lock(peerhash_mtx);  	// register cleanup handler -	pthread_cleanup_push(&peer_keepalives_finish, NULL); +	pthread_cleanup_push(&bgp_keepalives_finish, NULL);  	bgp_keepalives_thread_run = true; @@ -230,7 +230,7 @@ void *peer_keepalives_start(void *arg)  /* --- thread external functions ------------------------------------------- */ -void peer_keepalives_on(struct peer *peer) +void bgp_keepalives_on(struct peer *peer)  {  	/* placeholder bucket data to use for fast key lookups */  	static struct pkat holder = {0}; @@ -246,10 +246,10 @@ void peer_keepalives_on(struct peer *peer)  		SET_FLAG(peer->thread_flags, PEER_THREAD_KEEPALIVES_ON);  	}  	pthread_mutex_unlock(peerhash_mtx); -	peer_keepalives_wake(); +	bgp_keepalives_wake();  } -void peer_keepalives_off(struct peer *peer) +void bgp_keepalives_off(struct peer *peer)  {  	/* placeholder bucket data to use for fast key lookups */  	static struct pkat holder = {0}; @@ -267,7 +267,7 @@ void peer_keepalives_off(struct peer *peer)  	pthread_mutex_unlock(peerhash_mtx);  } -void peer_keepalives_wake() +void bgp_keepalives_wake()  {  	pthread_mutex_lock(peerhash_mtx);  	{ @@ -276,10 +276,10 @@ void peer_keepalives_wake()  	pthread_mutex_unlock(peerhash_mtx);  } -int peer_keepalives_stop(void **result, struct frr_pthread *fpt) +int bgp_keepalives_stop(void **result, struct frr_pthread *fpt)  {  	bgp_keepalives_thread_run = false; -	peer_keepalives_wake(); +	bgp_keepalives_wake();  	pthread_join(fpt->thread, result);  	return 0;  } diff --git a/bgpd/bgp_keepalives.h b/bgpd/bgp_keepalives.h index 602b0da77a..5729117b01 100644 --- a/bgpd/bgp_keepalives.h +++ b/bgpd/bgp_keepalives.h @@ -43,13 +43,13 @@ extern bool bgp_keepalives_thread_run;   * peer->obuf. This operation is thread-safe with respect to peer->obuf.   *   * peer->v_keepalive determines the interval. Changing this value before - * unregistering this peer with peer_keepalives_off() results in undefined + * unregistering this peer with bgp_keepalives_off() results in undefined   * behavior.   *   * If the peer is already registered for keepalives via this function, nothing   * happens.   */ -extern void peer_keepalives_on(struct peer *); +extern void bgp_keepalives_on(struct peer *);  /* Turns off keepalives for a peer.   * @@ -57,25 +57,25 @@ extern void peer_keepalives_on(struct peer *);   *   * If the peer is already unregistered for keepalives, nothing happens.   */ -extern void peer_keepalives_off(struct peer *); +extern void bgp_keepalives_off(struct peer *);  /* Pre-run initialization function for keepalives pthread.   *   * Initializes synchronization primitives. This should be called before   * anything else to avoid race conditions.   */ -extern void peer_keepalives_init(void); +extern void bgp_keepalives_init(void);  /* Entry function for keepalives pthread.   *   * This function loops over an internal list of peers, generating keepalives at   * regular intervals as determined by each peer's keepalive timer.   * - * See peer_keepalives_on() for additional details. + * See bgp_keepalives_on() for additional details.   *   * @param arg pthread arg, not used   */ -extern void *peer_keepalives_start(void *arg); +extern void *bgp_keepalives_start(void *arg);  /* Poking function for keepalives pthread.   * @@ -84,11 +84,11 @@ extern void *peer_keepalives_start(void *arg);   * thread to wake up and see if there is any work to do, or if it is time to   * die.   * - * It is not necessary to call this after peer_keepalives_on(). + * It is not necessary to call this after bgp_keepalives_on().   */ -extern void peer_keepalives_wake(void); +extern void bgp_keepalives_wake(void);  /* stop function */ -int peer_keepalives_stop(void **result, struct frr_pthread *fpt); +int bgp_keepalives_stop(void **result, struct frr_pthread *fpt);  #endif /* _BGP_KEEPALIVES_H */ diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index c034eda245..361a995a69 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -7407,10 +7407,10 @@ void bgp_pthreads_init()  	frr_pthread_new("BGP i/o thread", PTHREAD_IO, bgp_io_start,  			bgp_io_stop);  	frr_pthread_new("BGP keepalives thread", PTHREAD_KEEPALIVES, -			peer_keepalives_start, peer_keepalives_stop); +			bgp_keepalives_start, bgp_keepalives_stop);  	/* pre-run initialization */ -	peer_keepalives_init(); +	bgp_keepalives_init();  	bgp_io_init();  }  | 
