]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: rename peer_keepalives* --> bgp_keepalives*
authorQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 12 May 2017 03:54:18 +0000 (03:54 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 30 Nov 2017 21:17:59 +0000 (16:17 -0500)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
bgpd/bgp_fsm.c
bgpd/bgp_keepalives.c
bgpd/bgp_keepalives.h
bgpd/bgpd.c

index 18262e6e943c3a589671aae8d4836d20514fadc9..0c0c29b740ed762e9684cb8373f58885aa8610a0 100644 (file)
@@ -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);
index c7383ae77fb873ea435a4c7478bcfca597770907..dc21f197c93599c54fa607620c2f5e4d57bc72ec 100644 (file)
@@ -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;
 }
index 602b0da77a95ca78d2cce843f9c706c437642845..5729117b0109ca8d7b27d15ff24723ddd836f134 100644 (file)
@@ -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 */
index c034eda24503671dc6a176b367a65e67b2e41b9a..361a995a696575bd28c13a0c5e907795cedad306 100644 (file)
@@ -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();
 }