]> git.puffer.fish Git - mirror/frr.git/commitdiff
*: Convert thread_timer_remain_XXX to event_timer_remain_XXX
authorDonald Sharp <sharpd@nvidia.com>
Sun, 11 Dec 2022 13:19:00 +0000 (08:19 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Fri, 24 Mar 2023 12:32:17 +0000 (08:32 -0400)
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
25 files changed:
bgpd/bgp_bmp.c
bgpd/bgp_fsm.c
bgpd/bgp_route.c
bgpd/bgp_vty.c
bgpd/rfapi/rfapi_monitor.c
bgpd/rfapi/rfapi_vty.c
eigrpd/eigrp_dump.c
isisd/isis_ldp_sync.c
isisd/isis_lsp.c
isisd/isis_pdu.c
isisd/isisd.c
ldpd/adjacency.c
ldpd/interface.c
ldpd/neighbor.c
lib/event.c
lib/event.h
lib/spf_backoff.c
ospf6d/ospf6_gr_helper.c
ospfd/ospf_vty.c
pimd/pim6_mld.c
pimd/pim_ifchannel.c
pimd/pim_time.c
ripd/ripd.c
ripngd/ripngd.c
zebra/zserv.c

index 474ec0622c8e21ba8a50c1276d7b0cc36bcee4cf..8b953e5c9041e976514964615cb981e42d1eb45c 100644 (file)
@@ -2408,7 +2408,7 @@ DEFPY(show_bmp,
                                uptime[0] = '\0';
 
                                if (ba->t_timer) {
-                                       long trem = thread_timer_remain_second(
+                                       long trem = event_timer_remain_second(
                                                ba->t_timer);
 
                                        peer_uptime(monotime(NULL) - trem,
index 001a8da1cc4f89affac8917afdc57d506e7cf238..9e9861310c211b894a654d8d3c78c9c84f6fefef 100644 (file)
@@ -1046,7 +1046,7 @@ void bgp_adjust_routeadv(struct peer *peer)
         *                     (MRAI - m) < r
         */
        if (peer->t_routeadv)
-               remain = thread_timer_remain_second(peer->t_routeadv);
+               remain = event_timer_remain_second(peer->t_routeadv);
        else
                remain = peer->v_routeadv;
        diff = peer->v_routeadv - diff;
index 8b56d04e64351778d5c25dc7a8b1fae4f84410c0..f2451e588eeb89fb499b79ee07e82f6b6b7682c1 100644 (file)
@@ -11105,7 +11105,7 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct bgp_dest *bn,
        if (path->peer->t_gr_restart &&
            CHECK_FLAG(path->flags, BGP_PATH_STALE)) {
                unsigned long gr_remaining =
-                       thread_timer_remain_second(path->peer->t_gr_restart);
+                       event_timer_remain_second(path->peer->t_gr_restart);
 
                if (json_paths) {
                        json_object_int_add(json_path,
@@ -11121,7 +11121,7 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct bgp_dest *bn,
            bgp_attr_get_community(attr) &&
            community_include(bgp_attr_get_community(attr),
                              COMMUNITY_LLGR_STALE)) {
-               unsigned long llgr_remaining = thread_timer_remain_second(
+               unsigned long llgr_remaining = event_timer_remain_second(
                        path->peer->t_llgr_stale[afi][safi]);
 
                if (json_paths) {
index e0476c0cef4571adb5c7f37fc279f2e5bee89f1e..bc0681df781909a83588756fcb5f0383fe944b98 100644 (file)
@@ -12330,7 +12330,7 @@ static void bgp_show_neighbor_graceful_restart_capability_per_afi_safi(
                        if (peer->t_gr_stale != NULL) {
                                json_object_int_add(json_timer,
                                                    "stalePathTimerRemaining",
-                                                   thread_timer_remain_second(
+                                                   event_timer_remain_second(
                                                            peer->t_gr_stale));
                        }
 
@@ -12351,7 +12351,7 @@ static void bgp_show_neighbor_graceful_restart_capability_per_afi_safi(
                                json_object_int_add(
                                        json_timer,
                                        "selectionDeferralTimerRemaining",
-                                       thread_timer_remain_second(
+                                       event_timer_remain_second(
                                                peer->bgp->gr_info[afi][safi]
                                                        .t_select_deferral));
                        }
@@ -12364,7 +12364,7 @@ static void bgp_show_neighbor_graceful_restart_capability_per_afi_safi(
                        if (peer->t_gr_stale != NULL)
                                vty_out(vty,
                                        "      Stale Path Remaining(sec): %ld\n",
-                                       thread_timer_remain_second(
+                                       event_timer_remain_second(
                                                peer->t_gr_stale));
                        /* Display Configured Selection
                         * Deferral only when when
@@ -12379,7 +12379,7 @@ static void bgp_show_neighbor_graceful_restart_capability_per_afi_safi(
                            NULL)
                                vty_out(vty,
                                        "        Selection Deferral Time Remaining(sec): %ld\n",
-                                       thread_timer_remain_second(
+                                       event_timer_remain_second(
                                                peer->bgp->gr_info[afi][safi]
                                                        .t_select_deferral));
                }
@@ -12413,7 +12413,7 @@ static void bgp_show_neighbor_graceful_restart_time(struct vty *vty,
                if (p->t_gr_restart != NULL)
                        json_object_int_add(
                                json_timer, "restartTimerRemaining",
-                               thread_timer_remain_second(p->t_gr_restart));
+                               event_timer_remain_second(p->t_gr_restart));
 
                json_object_object_add(json, "timers", json_timer);
        } else {
@@ -12426,10 +12426,10 @@ static void bgp_show_neighbor_graceful_restart_time(struct vty *vty,
                        p->v_gr_restart);
                if (p->t_gr_restart != NULL)
                        vty_out(vty, "      Restart Time Remaining(sec): %ld\n",
-                               thread_timer_remain_second(p->t_gr_restart));
+                               event_timer_remain_second(p->t_gr_restart));
                if (p->t_gr_restart != NULL) {
                        vty_out(vty, "      Restart Time Remaining(sec): %ld\n",
-                               thread_timer_remain_second(p->t_gr_restart));
+                               event_timer_remain_second(p->t_gr_restart));
                }
        }
 }
@@ -13464,7 +13464,7 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
                        json_object_int_add(
                                json_neigh,
                                "bgpTimerUntilConditionalAdvertisementsSec",
-                               thread_timer_remain_second(
+                               event_timer_remain_second(
                                        bgp->t_condition_check));
        } else {
                /* Administrative shutdown. */
@@ -13544,7 +13544,7 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
                if (thread_is_scheduled(bgp->t_condition_check))
                        vty_out(vty,
                                "  Time until conditional advertisements begin is %lu seconds\n",
-                               thread_timer_remain_second(
+                               event_timer_remain_second(
                                        bgp->t_condition_check));
        }
        /* Capability. */
@@ -14481,13 +14481,13 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
                if (p->t_gr_restart)
                        json_object_int_add(
                                json_grace, "gracefulRestartTimerMsecs",
-                               thread_timer_remain_second(p->t_gr_restart) *
+                               event_timer_remain_second(p->t_gr_restart) *
                                        1000);
 
                if (p->t_gr_stale)
                        json_object_int_add(
                                json_grace, "gracefulStalepathTimerMsecs",
-                               thread_timer_remain_second(p->t_gr_stale) *
+                               event_timer_remain_second(p->t_gr_stale) *
                                        1000);
                /* more gr info in new format */
                BGP_SHOW_PEER_GR_CAPABILITY(vty, p, json_grace);
@@ -14528,12 +14528,12 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
                if (p->t_gr_restart)
                        vty_out(vty,
                                "    The remaining time of restart timer is %ld\n",
-                               thread_timer_remain_second(p->t_gr_restart));
+                               event_timer_remain_second(p->t_gr_restart));
 
                if (p->t_gr_stale)
                        vty_out(vty,
                                "    The remaining time of stalepath timer is %ld\n",
-                               thread_timer_remain_second(p->t_gr_stale));
+                               event_timer_remain_second(p->t_gr_stale));
 
                /* more gr info in new format */
                BGP_SHOW_PEER_GR_CAPABILITY(vty, p, NULL);
@@ -14767,14 +14767,15 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
                                        json_neigh, "reducePrefixNumFrom");
                                json_object_int_add(json_neigh,
                                                    "restartInTimerMsec",
-                                                   thread_timer_remain_second(
-                                                           p->t_pmax_restart)
-                                                           1000);
+                                                   event_timer_remain_second(
+                                                           p->t_pmax_restart) *
+                                                           1000);
                        } else
                                vty_out(vty,
                                        "  Reduce the no. of prefix from %s, will restart in %ld seconds\n",
-                                       p->host, thread_timer_remain_second(
-                                                        p->t_pmax_restart));
+                                       p->host,
+                                       event_timer_remain_second(
+                                               p->t_pmax_restart));
                } else {
                        if (use_json)
                                json_object_boolean_true_add(
@@ -14926,19 +14927,18 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
                if (p->t_start)
                        json_object_int_add(
                                json_neigh, "nextStartTimerDueInMsecs",
-                               thread_timer_remain_second(p->t_start) * 1000);
+                               event_timer_remain_second(p->t_start) * 1000);
                if (p->t_connect)
                        json_object_int_add(
                                json_neigh, "nextConnectTimerDueInMsecs",
-                               thread_timer_remain_second(p->t_connect)
-                                       * 1000);
+                               event_timer_remain_second(p->t_connect) * 1000);
                if (p->t_routeadv) {
                        json_object_int_add(json_neigh, "mraiInterval",
                                            p->v_routeadv);
                        json_object_int_add(
                                json_neigh, "mraiTimerExpireInMsecs",
-                               thread_timer_remain_second(p->t_routeadv)
-                                       1000);
+                               event_timer_remain_second(p->t_routeadv) *
+                                       1000);
                }
                if (p->password)
                        json_object_int_add(json_neigh, "authenticationEnabled",
@@ -14967,15 +14967,15 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
                }
                if (p->t_start)
                        vty_out(vty, "Next start timer due in %ld seconds\n",
-                               thread_timer_remain_second(p->t_start));
+                               event_timer_remain_second(p->t_start));
                if (p->t_connect)
                        vty_out(vty, "Next connect timer due in %ld seconds\n",
-                               thread_timer_remain_second(p->t_connect));
+                               event_timer_remain_second(p->t_connect));
                if (p->t_routeadv)
                        vty_out(vty,
                                "MRAI (interval %u) timer expires in %ld seconds\n",
                                p->v_routeadv,
-                               thread_timer_remain_second(p->t_routeadv));
+                               event_timer_remain_second(p->t_routeadv));
                if (p->password)
                        vty_out(vty, "Peer Authentication Enabled\n");
 
@@ -18798,7 +18798,7 @@ static void bgp_config_end(void)
 #define BGP_POST_CONFIG_DELAY_SECONDS 1
        uint32_t bgp_post_config_delay =
                thread_is_scheduled(bm->t_rmap_update)
-                       ? thread_timer_remain_second(bm->t_rmap_update)
+                       ? event_timer_remain_second(bm->t_rmap_update)
                        : BGP_POST_CONFIG_DELAY_SECONDS;
 
        /* If BGP config processing thread isn't running, then
index 2bcfa5779c506de2a1367716908e20fc23116efe..d3a1b84b59c389ff5de5039a0a5b86514b55fcae 100644 (file)
@@ -743,7 +743,7 @@ static void rfapiMonitorTimerExpire(struct event *t)
 
 static void rfapiMonitorTimerRestart(struct rfapi_monitor_vpn *m)
 {
-       unsigned long remain = thread_timer_remain_second(m->timer);
+       unsigned long remain = event_timer_remain_second(m->timer);
 
        /* unexpected case, but avoid wraparound problems below */
        if (remain > m->rfd->response_lifetime)
@@ -1051,7 +1051,7 @@ static void rfapiMonitorEthTimerExpire(struct event *t)
 
 static void rfapiMonitorEthTimerRestart(struct rfapi_monitor_eth *m)
 {
-       unsigned long remain = thread_timer_remain_second(m->timer);
+       unsigned long remain = event_timer_remain_second(m->timer);
 
        /* unexpected case, but avoid wraparound problems below */
        if (remain > m->rfd->response_lifetime)
index b907c24c3dab743dfe6933ccf72b1ca87089d1c7..901ea22b8ff5aae139519aac1146b2b2d9205ff6 100644 (file)
@@ -518,7 +518,7 @@ void rfapiPrintBi(void *stream, struct bgp_path_info *bpi)
            && bpi->extra->vnc.import.timer) {
                struct event *t = (struct event *)bpi->extra->vnc.import.timer;
                r = snprintf(p, REMAIN, " [%4lu] ",
-                            thread_timer_remain_second(t));
+                            event_timer_remain_second(t));
                INCP;
 
        } else {
@@ -909,7 +909,7 @@ int rfapiShowVncQueries(void *stream, struct prefix *pfx_match)
                                        fp(out, "%-15s %-15s", "", "");
                                buf_remain[0] = 0;
                                rfapiFormatSeconds(
-                                       thread_timer_remain_second(m->timer),
+                                       event_timer_remain_second(m->timer),
                                        buf_remain, BUFSIZ);
                                fp(out, " %-15s %-10s\n",
                                   inet_ntop(m->p.family, &m->p.u.prefix,
@@ -982,7 +982,7 @@ int rfapiShowVncQueries(void *stream, struct prefix *pfx_match)
                                } else
                                        fp(out, "%-15s %-15s", "", "");
                                buf_remain[0] = 0;
-                               rfapiFormatSeconds(thread_timer_remain_second(
+                               rfapiFormatSeconds(event_timer_remain_second(
                                                           mon_eth->timer),
                                                   buf_remain, BUFSIZ);
                                fp(out, " %-17s %10d %-10s\n",
@@ -1114,7 +1114,7 @@ static int rfapiPrintRemoteRegBi(struct bgp *bgp, void *stream,
                char buf_age[BUFSIZ];
 
                struct event *t = (struct event *)bpi->extra->vnc.import.timer;
-               remaining = thread_timer_remain_second(t);
+               remaining = event_timer_remain_second(t);
 
 #ifdef RFAPI_REGISTRATIONS_REPORT_AGE
                /*
index b7c7e0070dbe0dd9238b9c89d66c5c2960a4aa9b..8afc34369a40167ff9c80be91cc83557cf1790a2 100644 (file)
@@ -192,7 +192,7 @@ void show_ip_eigrp_neighbor_sub(struct vty *vty, struct eigrp_neighbor *nbr,
        vty_out(vty, "%-3u %-17pI4 %-21s", 0, &nbr->src, IF_NAME(nbr->ei));
        if (nbr->t_holddown)
                vty_out(vty, "%-7lu",
-                       thread_timer_remain_second(nbr->t_holddown));
+                       event_timer_remain_second(nbr->t_holddown));
        else
                vty_out(vty, "-      ");
        vty_out(vty, "%-8u %-6u %-5u", 0, 0, EIGRP_PACKET_RETRANS_TIME);
index 65ca7ac3cc35f0517686cf042f844309909725f5..6c9292ffc0bf6d05685b94b4641de3ab40dcc603 100644 (file)
@@ -575,8 +575,8 @@ static void isis_circuit_ldp_sync_print_vty(struct isis_circuit *circuit,
                break;
        case LDP_IGP_SYNC_STATE_REQUIRED_NOT_UP:
                if (ldp_sync_info->t_holddown != NULL) {
-                       struct timeval remain = thread_timer_remain(
-                               ldp_sync_info->t_holddown);
+                       struct timeval remain =
+                               event_timer_remain(ldp_sync_info->t_holddown);
                        vty_out(vty,
                                "  Holddown timer is running %lld.%03lld remaining\n",
                                (long long)remain.tv_sec,
index 62912addcb4c7a5535fa73761c81db9105c0ff4d..114a499ddbbc603f3f347a3692a5551ba89adfe3 100644 (file)
@@ -1603,7 +1603,7 @@ int _lsp_regenerate_schedule(struct isis_area *area, int level,
                         * Note: in case of a BFD 'down' message the refresh is
                         * scheduled once again just to be sure
                         */
-                       struct timeval remain = thread_timer_remain(
+                       struct timeval remain = event_timer_remain(
                                area->t_lsp_refresh[lvl - 1]);
                        sched_debug(
                                "ISIS (%s): Regeneration is already pending, nothing todo. (Due in %lld.%03lld seconds)",
@@ -1986,7 +1986,7 @@ int lsp_regenerate_schedule_pseudo(struct isis_circuit *circuit, int level)
                }
 
                if (circuit->lsp_regenerate_pending[lvl - 1]) {
-                       struct timeval remain = thread_timer_remain(
+                       struct timeval remain = event_timer_remain(
                                circuit->u.bc.t_refresh_pseudo_lsp[lvl - 1]);
                        sched_debug(
                                "ISIS (%s): Regenerate is already pending, nothing todo. (Due in %lld.%03lld seconds)",
index 3e8cb3f72a343752b98f90991bb0dde45417ef72..00ee7f8ebbbb32ec55c14df7949a948bd876cee0 100644 (file)
@@ -2053,7 +2053,7 @@ static void _send_hello_sched(struct isis_circuit *circuit,
                              struct event **threadp, int level, long delay)
 {
        if (*threadp) {
-               if (thread_timer_remain_msec(*threadp) < (unsigned long)delay)
+               if (event_timer_remain_msec(*threadp) < (unsigned long)delay)
                        return;
 
                THREAD_OFF(*threadp);
index 86dbc228f9bc1792a1ed377ff1d3e4b62eb00e03..14641f67cc3fd33246ead91531008170f09589ef 100644 (file)
@@ -2250,7 +2250,7 @@ static void isis_spf_ietf_common(struct vty *vty, struct isis *isis)
                        vty_out(vty, "  Level-%d:\n", level);
                        vty_out(vty, "    SPF delay status: ");
                        if (area->spf_timer[level - 1]) {
-                               struct timeval remain = thread_timer_remain(
+                               struct timeval remain = event_timer_remain(
                                        area->spf_timer[level - 1]);
                                vty_out(vty, "Pending, due in %lld msec\n",
                                        (long long)remain.tv_sec * 1000
index d9a9d434a5788d69f4e02f007644bfdebd137eb6..794bc66ce9016a5bff8a12b7b73e71693d830599 100644 (file)
@@ -375,7 +375,7 @@ adj_to_ctl(struct adj *adj)
        }
        actl.holdtime = adj->holdtime;
        actl.holdtime_remaining =
-               thread_timer_remain_second(adj->inactivity_timer);
+               event_timer_remain_second(adj->inactivity_timer);
        actl.trans_addr = adj->trans_addr;
        actl.ds_tlv = adj->ds_tlv;
 
index 5a6ea9c51809b7f4f76fba58f9e78c8590d27ca4..32a23bf0bef8ad7611104ae378bf3147081c9225 100644 (file)
@@ -533,7 +533,7 @@ ldp_sync_to_ctl(struct iface *iface)
        ictl.timer_running = iface->ldp_sync.wait_for_sync_timer ? true : false;
 
        ictl.wait_time_remaining =
-               thread_timer_remain_second(iface->ldp_sync.wait_for_sync_timer);
+               event_timer_remain_second(iface->ldp_sync.wait_for_sync_timer);
 
        memset(&ictl.peer_ldp_id, 0, sizeof(ictl.peer_ldp_id));
 
index e0cd0ec3940cb00218a9865a3b941630fa0c2fb5..50a35e9f61ac92f4d92b3841b077183a2e417cf9 100644 (file)
@@ -835,7 +835,7 @@ nbr_to_ctl(struct nbr *nbr)
        nctl.flags = nbr->flags;
        nctl.max_pdu_len = nbr->max_pdu_len;
        nctl.hold_time_remaining =
-               thread_timer_remain_second(nbr->keepalive_timer);
+               event_timer_remain_second(nbr->keepalive_timer);
 
        gettimeofday(&now, NULL);
        if (nbr->state == NBR_STA_OPER) {
index 12b40e112160df0c550dd11e749439dba10ff856..8355b3cdd4de63e848fd72c8e2c2013dda1446d6 100644 (file)
@@ -733,7 +733,7 @@ void thread_master_free(struct thread_master *m)
 }
 
 /* Return remain time in milliseconds. */
-unsigned long thread_timer_remain_msec(struct event *thread)
+unsigned long event_timer_remain_msec(struct event *thread)
 {
        int64_t remain;
 
@@ -748,12 +748,12 @@ unsigned long thread_timer_remain_msec(struct event *thread)
 }
 
 /* Return remain time in seconds. */
-unsigned long thread_timer_remain_second(struct event *thread)
+unsigned long event_timer_remain_second(struct event *thread)
 {
-       return thread_timer_remain_msec(thread) / 1000LL;
+       return event_timer_remain_msec(thread) / 1000LL;
 }
 
-struct timeval thread_timer_remain(struct event *thread)
+struct timeval event_timer_remain(struct event *thread)
 {
        struct timeval remain;
        frr_with_mutex (&thread->mtx) {
@@ -783,8 +783,7 @@ static int time_hhmmss(char *buf, int buf_size, long sec)
 char *thread_timer_to_hhmmss(char *buf, int buf_size, struct event *t_timer)
 {
        if (t_timer) {
-               time_hhmmss(buf, buf_size,
-                               thread_timer_remain_second(t_timer));
+               time_hhmmss(buf, buf_size, event_timer_remain_second(t_timer));
        } else {
                snprintf(buf, buf_size, "--:--:--");
        }
index cdb22848150c5b139ffbd4666c807265e0f65258..68f97bb8524b0a9117721d000aef9801313e4a3f 100644 (file)
@@ -251,9 +251,9 @@ extern void event_cancel_event_ready(struct thread_master *m, void *arg);
 extern void event_cancel_event(struct thread_master *m, void *arg);
 extern struct event *event_fetch(struct thread_master *, struct event *event);
 extern void event_call(struct event *event);
-extern unsigned long thread_timer_remain_second(struct event *event);
-extern struct timeval thread_timer_remain(struct event *event);
-extern unsigned long thread_timer_remain_msec(struct event *event);
+extern unsigned long event_timer_remain_second(struct event *event);
+extern struct timeval event_timer_remain(struct event *event);
+extern unsigned long event_timer_remain_msec(struct event *event);
 extern int thread_should_yield(struct event *event);
 /* set yield time for thread */
 extern void thread_set_yield_time(struct event *event, unsigned long);
index 367386e6a4f6537d663dc72ba1f6da1a7135fcfb..7ea33c3abc49fe3107f8facd66c152b1d85c2e07 100644 (file)
@@ -204,8 +204,7 @@ void spf_backoff_show(struct spf_backoff *backoff, struct vty *vty,
        vty_out(vty, "%sHolddown timer:    %ld msec\n", prefix,
                backoff->holddown);
        if (backoff->t_holddown) {
-               struct timeval remain =
-                       thread_timer_remain(backoff->t_holddown);
+               struct timeval remain = event_timer_remain(backoff->t_holddown);
                vty_out(vty, "%s                   Still runs for %lld msec\n",
                        prefix,
                        (long long)remain.tv_sec * 1000
@@ -218,7 +217,7 @@ void spf_backoff_show(struct spf_backoff *backoff, struct vty *vty,
                backoff->timetolearn);
        if (backoff->t_timetolearn) {
                struct timeval remain =
-                       thread_timer_remain(backoff->t_timetolearn);
+                       event_timer_remain(backoff->t_timetolearn);
                vty_out(vty, "%s                   Still runs for %lld msec\n",
                        prefix,
                        (long long)remain.tv_sec * 1000
index 599c2944cf9555f32e11c3504d757eca4ffd2ae7..89f6b282b17a37078318a7fc5128b92eefad874b 100644 (file)
@@ -833,7 +833,7 @@ static void show_ospfv6_gr_helper_per_nbr(struct vty *vty, json_object *json,
                vty_out(vty, "   Actual Grace period : %d(in seconds)\n",
                        nbr->gr_helper_info.actual_grace_period);
                vty_out(vty, "   Remaining GraceTime:%ld(in seconds).\n",
-                       thread_timer_remain_second(
+                       event_timer_remain_second(
                                nbr->gr_helper_info.t_grace_timer));
                vty_out(vty, "   Graceful Restart reason: %s.\n\n",
                        ospf6_restart_reason_desc[nbr->gr_helper_info
@@ -850,8 +850,8 @@ static void show_ospfv6_gr_helper_per_nbr(struct vty *vty, json_object *json,
                json_object_int_add(json_neigh, "actualGraceInterval",
                        nbr->gr_helper_info.actual_grace_period);
                json_object_int_add(json_neigh, "remainGracetime",
-                       thread_timer_remain_second(
-                               nbr->gr_helper_info.t_grace_timer));
+                                   event_timer_remain_second(
+                                           nbr->gr_helper_info.t_grace_timer));
                json_object_string_add(json_neigh, "restartReason",
                        ospf6_restart_reason_desc[
                                nbr->gr_helper_info.gr_restart_reason]);
index 610422bd54df7d4ced62903c329f8212682b790c..c53788dd724a4c802b246c28b9352c5a64871f5d 100644 (file)
@@ -10136,9 +10136,9 @@ static int ospf_show_gr_helper_details(struct vty *vty, struct ospf *ospf,
                                                        .actual_grace_period);
                                        vty_out(vty,
                                                "   Remaining GraceTime:%ld(in seconds).\n",
-                                               thread_timer_remain_second(
+                                               event_timer_remain_second(
                                                        nbr->gr_helper_info
-                                                       .t_grace_timer));
+                                                               .t_grace_timer));
                                        vty_out(vty,
                                                "   Graceful Restart reason: %s.\n\n",
                                                ospf_restart_reason2str(
@@ -10169,9 +10169,9 @@ static int ospf_show_gr_helper_details(struct vty *vty, struct ospf *ospf,
                                                        .actual_grace_period);
                                        json_object_int_add(
                                                json_neigh, "remainGracetime",
-                                               thread_timer_remain_second(
+                                               event_timer_remain_second(
                                                        nbr->gr_helper_info
-                                                       .t_grace_timer));
+                                                               .t_grace_timer));
                                        json_object_string_add(
                                                json_neigh, "restartReason",
                                                ospf_restart_reason2str(
index 52dbfddd9ad296db0ffe2dd62f6bebe3228dd2d1..5a33fdb264c7a194b5ae179ab1f40295f44a4ad2 100644 (file)
@@ -1208,7 +1208,7 @@ static void gm_sg_timer_start(struct gm_if *gm_ifp, struct gm_sg *sg,
        if (sg->t_sg_expire) {
                struct timeval remain;
 
-               remain = thread_timer_remain(sg->t_sg_expire);
+               remain = event_timer_remain(sg->t_sg_expire);
                if (timercmp(&remain, &expire_wait, <=))
                        return;
 
@@ -1316,7 +1316,7 @@ static void gm_handle_q_group(struct gm_if *gm_ifp,
        if (pend) {
                struct timeval remain;
 
-               remain = thread_timer_remain(pend->t_expire);
+               remain = event_timer_remain(pend->t_expire);
                if (timercmp(&remain, &timers->expire_wait, <=))
                        return;
 
index 80fc2879c5a28ff229258dc054a5bdaff548ed25..41b093ab507c709e1c86487207961bea8bc88476 100644 (file)
@@ -896,7 +896,7 @@ void pim_ifchannel_join_add(struct interface *ifp, pim_addr neigh_addr,
                  previously received join message with holdtime=0xFFFF.
                 */
                if (ch->t_ifjoin_expiry_timer) {
-                       unsigned long remain = thread_timer_remain_second(
+                       unsigned long remain = event_timer_remain_second(
                                ch->t_ifjoin_expiry_timer);
                        if (remain > holdtime) {
                                /*
@@ -964,7 +964,7 @@ void pim_ifchannel_join_add(struct interface *ifp, pim_addr neigh_addr,
                pim_ifchannel_ifjoin_handler(ch, pim_ifp);
 
                if (ch->t_ifjoin_expiry_timer) {
-                       unsigned long remain = thread_timer_remain_second(
+                       unsigned long remain = event_timer_remain_second(
                                ch->t_ifjoin_expiry_timer);
 
                        if (remain > holdtime)
@@ -1087,7 +1087,7 @@ void pim_ifchannel_prune(struct interface *ifp, pim_addr upstream,
                         * Join/Prune message.
                         */
                        if (ch->t_ifjoin_expiry_timer) {
-                               unsigned long rem = thread_timer_remain_second(
+                               unsigned long rem = event_timer_remain_second(
                                        ch->t_ifjoin_expiry_timer);
 
                                if (rem > holdtime)
index 23f800cf88bdb0dd61d85911c39b0504d73265db..7b10d91144990ee90e2881f33c0acf1505f2133d 100644 (file)
@@ -125,7 +125,7 @@ void pim_time_timer_to_mmss(char *buf, int buf_size, struct event *t_timer)
 {
        if (t_timer) {
                pim_time_mmss(buf, buf_size,
-                             thread_timer_remain_second(t_timer));
+                             event_timer_remain_second(t_timer));
        } else {
                snprintf(buf, buf_size, "--:--");
        }
@@ -135,7 +135,7 @@ void pim_time_timer_to_hhmmss(char *buf, int buf_size, struct event *t_timer)
 {
        if (t_timer) {
                pim_time_hhmmss(buf, buf_size,
-                               thread_timer_remain_second(t_timer));
+                               event_timer_remain_second(t_timer));
        } else {
                snprintf(buf, buf_size, "--:--:--");
        }
@@ -160,5 +160,5 @@ long pim_time_timer_remain_msec(struct event *t_timer)
 {
        /* no timer thread running means timer has expired: return 0 */
 
-       return t_timer ? thread_timer_remain_msec(t_timer) : 0;
+       return t_timer ? event_timer_remain_msec(t_timer) : 0;
 }
index 70bcfef4e480676e6175b7ccc232bf90dab2f036..7661767514e1b2fd4fc6d518ebd62cad1e4eeb65 100644 (file)
@@ -2926,12 +2926,12 @@ static void rip_vty_out_uptime(struct vty *vty, struct rip_info *rinfo)
        struct event *thread;
 
        if ((thread = rinfo->t_timeout) != NULL) {
-               clock = thread_timer_remain_second(thread);
+               clock = event_timer_remain_second(thread);
                gmtime_r(&clock, &tm);
                strftime(timebuf, TIME_BUF, "%M:%S", &tm);
                vty_out(vty, "%5s", timebuf);
        } else if ((thread = rinfo->t_garbage_collect) != NULL) {
-               clock = thread_timer_remain_second(thread);
+               clock = event_timer_remain_second(thread);
                gmtime_r(&clock, &tm);
                strftime(timebuf, TIME_BUF, "%M:%S", &tm);
                vty_out(vty, "%5s", timebuf);
@@ -3106,7 +3106,7 @@ DEFUN (show_ip_rip_status,
        vty_out(vty, "  Sending updates every %u seconds with +/-50%%,",
                rip->update_time);
        vty_out(vty, " next due in %lu seconds\n",
-               thread_timer_remain_second(rip->t_update));
+               event_timer_remain_second(rip->t_update));
        vty_out(vty, "  Timeout after %u seconds,", rip->timeout_time);
        vty_out(vty, " garbage collect after %u seconds\n", rip->garbage_time);
 
index 00d0414b7efb31ac817d8d05a9126b5100b74735..10a9ce5741ddddf5c5da233ed225e7f0bd6ccc13 100644 (file)
@@ -877,18 +877,18 @@ static void ripng_route_process(struct rte *rte, struct sockaddr_in6 *from,
                 * but
                 * highly recommended".
                 */
-               if (!ripng->ecmp && !same && rinfo->metric == rte->metric
-                   && rinfo->t_timeout
-                   && (thread_timer_remain_second(rinfo->t_timeout)
-                       < (ripng->timeout_time / 2))) {
+               if (!ripng->ecmp && !same && rinfo->metric == rte->metric &&
+                   rinfo->t_timeout &&
+                   (event_timer_remain_second(rinfo->t_timeout) <
+                    (ripng->timeout_time / 2))) {
                        ripng_ecmp_replace(ripng, &newinfo);
                }
                /* Next, compare the metrics.  If the datagram is from the same
                   router as the existing route, and the new metric is different
                   than the old one; or, if the new metric is lower than the old
                   one; do the following actions: */
-               else if ((same && rinfo->metric != rte->metric)
-                        || rte->metric < rinfo->metric) {
+               else if ((same && rinfo->metric != rte->metric) ||
+                        rte->metric < rinfo->metric) {
                        if (listcount(list) == 1) {
                                if (newinfo.metric != RIPNG_METRIC_INFINITY)
                                        ripng_ecmp_replace(ripng, &newinfo);
@@ -1934,12 +1934,12 @@ static void ripng_vty_out_uptime(struct vty *vty, struct ripng_info *rinfo)
        struct event *thread;
 
        if ((thread = rinfo->t_timeout) != NULL) {
-               clock = thread_timer_remain_second(thread);
+               clock = event_timer_remain_second(thread);
                gmtime_r(&clock, &tm);
                strftime(timebuf, TIME_BUF, "%M:%S", &tm);
                vty_out(vty, "%5s", timebuf);
        } else if ((thread = rinfo->t_garbage_collect) != NULL) {
-               clock = thread_timer_remain_second(thread);
+               clock = event_timer_remain_second(thread);
                gmtime_r(&clock, &tm);
                strftime(timebuf, TIME_BUF, "%M:%S", &tm);
                vty_out(vty, "%5s", timebuf);
@@ -2128,7 +2128,7 @@ DEFUN (show_ipv6_ripng_status,
        vty_out(vty, "  Sending updates every %u seconds with +/-50%%,",
                ripng->update_time);
        vty_out(vty, " next due in %lu seconds\n",
-               thread_timer_remain_second(ripng->t_update));
+               event_timer_remain_second(ripng->t_update));
        vty_out(vty, "  Timeout after %u seconds,", ripng->timeout_time);
        vty_out(vty, " garbage collect after %u seconds\n",
                ripng->garbage_time);
index f9eb7a8e3f862805159a3ff74a14ad8cca251b66..c25b61ea496f9988859d94f6113af1ecf2be119f 100644 (file)
@@ -1148,7 +1148,7 @@ static void zebra_show_stale_client_detail(struct vty *vty,
                                if (info->t_stale_removal) {
                                        vty_out(vty,
                                                "Stale delete timer: %ld sec\n",
-                                               thread_timer_remain_second(
+                                               event_timer_remain_second(
                                                        info->t_stale_removal));
                                }
                        }