]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #3174 from opensourcerouting/feature/isis-triggered-hello
authorOlivier Dugeon <olivier.dugeon@orange.com>
Tue, 4 Dec 2018 17:33:36 +0000 (18:33 +0100)
committerGitHub <noreply@github.com>
Tue, 4 Dec 2018 17:33:36 +0000 (18:33 +0100)
Feature: IS-IS triggered hello

17 files changed:
isisd/isis_adjacency.c
isisd/isis_circuit.c
isisd/isis_circuit.h
isisd/isis_constants.h
isisd/isis_dr.c
isisd/isis_dr.h
isisd/isis_events.c
isisd/isis_pdu.c
isisd/isis_pdu.h
lib/thread.c
lib/thread.h
tests/topotests/isis-topo1/r1/isisd.conf
tests/topotests/isis-topo1/r2/isisd.conf
tests/topotests/isis-topo1/r3/isisd.conf
tests/topotests/isis-topo1/r4/isisd.conf
tests/topotests/isis-topo1/r5/isisd.conf
tests/topotests/lib/topotest.py

index 9013c7c19b10e5df649f9b01ee59c32f34a7246c..b0f2947ec6bbac2baa2506fc64701a83cfc2856f 100644 (file)
@@ -215,21 +215,24 @@ void isis_adj_process_threeway(struct isis_adjacency *adj,
                }
        }
 
+       if (adj->threeway_state != next_tw_state) {
+               send_hello_sched(adj->circuit, 0, TRIGGERED_IIH_DELAY);
+       }
+
        adj->threeway_state = next_tw_state;
 }
 
 void isis_adj_state_change(struct isis_adjacency *adj,
                           enum isis_adj_state new_state, const char *reason)
 {
-       int old_state;
-       int level;
-       struct isis_circuit *circuit;
+       enum isis_adj_state old_state = adj->adj_state;
+       struct isis_circuit *circuit = adj->circuit;
        bool del;
 
-       old_state = adj->adj_state;
        adj->adj_state = new_state;
-
-       circuit = adj->circuit;
+       if (new_state != old_state) {
+               send_hello_sched(circuit, adj->level, TRIGGERED_IIH_DELAY);
+       }
 
        if (isis->debugs & DEBUG_ADJ_PACKETS) {
                zlog_debug("ISIS-Adj (%s): Adjacency state change %d->%d: %s",
@@ -257,7 +260,7 @@ void isis_adj_state_change(struct isis_adjacency *adj,
 
        if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
                del = false;
-               for (level = IS_LEVEL_1; level <= IS_LEVEL_2; level++) {
+               for (int level = IS_LEVEL_1; level <= IS_LEVEL_2; level++) {
                        if ((adj->level & level) == 0)
                                continue;
                        if (new_state == ISIS_ADJ_UP) {
@@ -298,16 +301,13 @@ void isis_adj_state_change(struct isis_adjacency *adj,
 
        } else if (circuit->circ_type == CIRCUIT_T_P2P) {
                del = false;
-               for (level = IS_LEVEL_1; level <= IS_LEVEL_2; level++) {
+               for (int level = IS_LEVEL_1; level <= IS_LEVEL_2; level++) {
                        if ((adj->level & level) == 0)
                                continue;
                        if (new_state == ISIS_ADJ_UP) {
                                circuit->upadjcount[level - 1]++;
                                hook_call(isis_adj_state_change_hook, adj);
 
-                               if (adj->sys_type == ISIS_SYSTYPE_UNKNOWN)
-                                       send_hello(circuit, level);
-
                                /* update counter & timers for debugging
                                 * purposes */
                                adj->last_flap = time(NULL);
@@ -337,8 +337,6 @@ void isis_adj_state_change(struct isis_adjacency *adj,
                if (del)
                        isis_delete_adj(adj);
        }
-
-       return;
 }
 
 
index 74488a1fcd8ee033bbe7c4a5e2673e3085d3936a..06385a4e1f5d7e47d112f988a4e1f2393b936abe 100644 (file)
@@ -89,6 +89,8 @@ struct isis_circuit *isis_circuit_new()
                circuit->priority[i] = DEFAULT_PRIORITY;
                circuit->metric[i] = DEFAULT_CIRCUIT_METRIC;
                circuit->te_metric[i] = DEFAULT_CIRCUIT_METRIC;
+               circuit->level_arg[i].level = i + 1;
+               circuit->level_arg[i].circuit = circuit;
        }
 
        circuit->mtc = mpls_te_circuit_new();
@@ -613,37 +615,27 @@ int isis_circuit_up(struct isis_circuit *circuit)
 
                /* 8.4.1 a) commence sending of IIH PDUs */
 
-               if (circuit->is_type & IS_LEVEL_1) {
-                       thread_add_event(master, send_lan_l1_hello, circuit, 0,
-                                        NULL);
-                       circuit->u.bc.lan_neighs[0] = list_new();
-               }
+               for (int level = ISIS_LEVEL1; level <= ISIS_LEVEL2; level++) {
+                       if (!(circuit->is_type & level))
+                               continue;
 
-               if (circuit->is_type & IS_LEVEL_2) {
-                       thread_add_event(master, send_lan_l2_hello, circuit, 0,
-                                        NULL);
-                       circuit->u.bc.lan_neighs[1] = list_new();
+                       send_hello_sched(circuit, level, TRIGGERED_IIH_DELAY);
+                       circuit->u.bc.lan_neighs[level - 1] = list_new();
+
+                       thread_add_timer(master, isis_run_dr,
+                                        &circuit->level_arg[level - 1],
+                                        2 * circuit->hello_interval[level - 1],
+                                        &circuit->u.bc.t_run_dr[level - 1]);
                }
 
                /* 8.4.1 b) FIXME: solicit ES - 8.4.6 */
                /* 8.4.1 c) FIXME: listen for ESH PDUs */
-
-               /* 8.4.1 d) */
-               /* dr election will commence in... */
-               if (circuit->is_type & IS_LEVEL_1)
-                       thread_add_timer(master, isis_run_dr_l1, circuit,
-                                        2 * circuit->hello_interval[0],
-                                        &circuit->u.bc.t_run_dr[0]);
-               if (circuit->is_type & IS_LEVEL_2)
-                       thread_add_timer(master, isis_run_dr_l2, circuit,
-                                        2 * circuit->hello_interval[1],
-                                        &circuit->u.bc.t_run_dr[1]);
        } else if (circuit->circ_type == CIRCUIT_T_P2P) {
                /* initializing the hello send threads
                 * for a ptp IF
                 */
                circuit->u.p2p.neighbor = NULL;
-               thread_add_event(master, send_p2p_hello, circuit, 0, NULL);
+               send_hello_sched(circuit, 0, TRIGGERED_IIH_DELAY);
        }
 
        /* initializing PSNP timers */
index e83424a4addfd668f5f00d7ac30c2ad8dea98248..7d7b25b92fd863b5456b7ed07b290c692a72f885 100644 (file)
@@ -67,6 +67,11 @@ struct isis_p2p_info {
 
 struct bfd_info;
 
+struct isis_circuit_arg {
+       int level;
+       struct isis_circuit *circuit;
+};
+
 struct isis_circuit {
        int state;
        uint8_t circuit_id;       /* l1/l2 bcast CircuitID */
@@ -83,6 +88,7 @@ struct isis_circuit {
        struct thread *t_send_psnp[2];
        struct thread *t_send_lsp;
        struct isis_tx_queue *tx_queue;
+       struct isis_circuit_arg level_arg[2]; /* used as argument for threads */
 
        /* there is no real point in two streams, just for programming kicker */
        int (*rx)(struct isis_circuit *circuit, uint8_t *ssnpa);
index 1046b0014c4fee743c543412f4aee8a75143b9bf..25eae06cb0af0d473957bb1232fd2ac486aded13 100644 (file)
@@ -75,6 +75,8 @@
 
 #define MIN_LSP_RETRANS_INTERVAL      5 /* Seconds */
 
+#define TRIGGERED_IIH_DELAY           50       /* msec */
+
 #define MIN_CSNP_INTERVAL             1
 #define MAX_CSNP_INTERVAL             600
 #define DEFAULT_CSNP_INTERVAL         10
index f71fe9555b8da9b7e1b64c24591a3fecdd840522..449648656a6b617c50782dfbaf1bf4506f164c07 100644 (file)
@@ -62,35 +62,28 @@ const char *isis_disflag2string(int disflag)
        return NULL; /* not reached */
 }
 
-int isis_run_dr_l1(struct thread *thread)
+int isis_run_dr(struct thread *thread)
 {
-       struct isis_circuit *circuit;
+       struct isis_circuit_arg *arg = THREAD_ARG(thread);
 
-       circuit = THREAD_ARG(thread);
-       assert(circuit);
-
-       if (circuit->u.bc.run_dr_elect[0])
-               zlog_warn("isis_run_dr(): run_dr_elect already set for l1");
-
-       circuit->u.bc.t_run_dr[0] = NULL;
-       circuit->u.bc.run_dr_elect[0] = 1;
+       assert(arg);
 
-       return ISIS_OK;
-}
+       struct isis_circuit *circuit = arg->circuit;
+       int level = arg->level;
 
-int isis_run_dr_l2(struct thread *thread)
-{
-       struct isis_circuit *circuit;
-
-       circuit = THREAD_ARG(thread);
        assert(circuit);
 
-       if (circuit->u.bc.run_dr_elect[1])
-               zlog_warn("isis_run_dr(): run_dr_elect already set for l2");
+       if (circuit->circ_type != CIRCUIT_T_BROADCAST) {
+               zlog_warn("%s: scheduled for non broadcast circuit from %s:%d",
+                         __func__, thread->schedfrom, thread->schedfrom_line);
+               return ISIS_WARNING;
+       }
 
+       if (circuit->u.bc.run_dr_elect[level - 1])
+               zlog_warn("isis_run_dr(): run_dr_elect already set for l%d", level);
 
-       circuit->u.bc.t_run_dr[1] = NULL;
-       circuit->u.bc.run_dr_elect[1] = 1;
+       circuit->u.bc.t_run_dr[level - 1] = NULL;
+       circuit->u.bc.run_dr_elect[level - 1] = 1;
 
        return ISIS_OK;
 }
@@ -241,12 +234,6 @@ int isis_dr_resign(struct isis_circuit *circuit, int level)
        if (level == 1) {
                memset(circuit->u.bc.l1_desig_is, 0, ISIS_SYS_ID_LEN + 1);
 
-               THREAD_TIMER_OFF(circuit->t_send_csnp[0]);
-
-               thread_add_timer(master, isis_run_dr_l1, circuit,
-                                2 * circuit->hello_interval[0],
-                                &circuit->u.bc.t_run_dr[0]);
-
                thread_add_timer(master, send_l1_psnp, circuit,
                                 isis_jitter(circuit->psnp_interval[level - 1],
                                             PSNP_JITTER),
@@ -254,18 +241,20 @@ int isis_dr_resign(struct isis_circuit *circuit, int level)
        } else {
                memset(circuit->u.bc.l2_desig_is, 0, ISIS_SYS_ID_LEN + 1);
 
-               THREAD_TIMER_OFF(circuit->t_send_csnp[1]);
-
-               thread_add_timer(master, isis_run_dr_l2, circuit,
-                                2 * circuit->hello_interval[1],
-                                &circuit->u.bc.t_run_dr[1]);
-
                thread_add_timer(master, send_l2_psnp, circuit,
                                 isis_jitter(circuit->psnp_interval[level - 1],
                                             PSNP_JITTER),
                                 &circuit->t_send_psnp[1]);
        }
 
+       THREAD_TIMER_OFF(circuit->t_send_csnp[level - 1]);
+
+       thread_add_timer(master, isis_run_dr,
+                        &circuit->level_arg[level - 1],
+                        2 * circuit->hello_interval[level - 1],
+                        &circuit->u.bc.t_run_dr[level - 1]);
+
+
        thread_add_event(master, isis_event_dis_status_change, circuit, 0,
                         NULL);
 
@@ -281,14 +270,6 @@ int isis_dr_commence(struct isis_circuit *circuit, int level)
 
        /* Lets keep a pause in DR election */
        circuit->u.bc.run_dr_elect[level - 1] = 0;
-       if (level == 1)
-               thread_add_timer(master, isis_run_dr_l1, circuit,
-                                2 * circuit->hello_interval[0],
-                                &circuit->u.bc.t_run_dr[0]);
-       else
-               thread_add_timer(master, isis_run_dr_l2, circuit,
-                                2 * circuit->hello_interval[1],
-                                &circuit->u.bc.t_run_dr[1]);
        circuit->u.bc.is_dr[level - 1] = 1;
 
        if (level == 1) {
@@ -307,11 +288,6 @@ int isis_dr_commence(struct isis_circuit *circuit, int level)
                   thread_cancel (circuit->t_send_l1_psnp); */
                lsp_generate_pseudo(circuit, 1);
 
-               THREAD_TIMER_OFF(circuit->u.bc.t_run_dr[0]);
-               thread_add_timer(master, isis_run_dr_l1, circuit,
-                                2 * circuit->hello_interval[0],
-                                &circuit->u.bc.t_run_dr[0]);
-
                thread_add_timer(master, send_l1_csnp, circuit,
                                 isis_jitter(circuit->csnp_interval[level - 1],
                                             CSNP_JITTER),
@@ -333,17 +309,16 @@ int isis_dr_commence(struct isis_circuit *circuit, int level)
                   thread_cancel (circuit->t_send_l1_psnp); */
                lsp_generate_pseudo(circuit, 2);
 
-               THREAD_TIMER_OFF(circuit->u.bc.t_run_dr[1]);
-               thread_add_timer(master, isis_run_dr_l2, circuit,
-                                2 * circuit->hello_interval[1],
-                                &circuit->u.bc.t_run_dr[1]);
-
                thread_add_timer(master, send_l2_csnp, circuit,
                                 isis_jitter(circuit->csnp_interval[level - 1],
                                             CSNP_JITTER),
                                 &circuit->t_send_csnp[1]);
        }
 
+       thread_add_timer(master, isis_run_dr,
+                        &circuit->level_arg[level - 1],
+                        2 * circuit->hello_interval[level - 1],
+                        &circuit->u.bc.t_run_dr[level - 1]);
        thread_add_event(master, isis_event_dis_status_change, circuit, 0,
                         NULL);
 
index ed26558b0826ca2c1e0f97d8bd5d2e0e5fc93393..5cab985d4b35c0b41c0c023232c7ae9b9a215262 100644 (file)
@@ -24,8 +24,7 @@
 #ifndef _ZEBRA_ISIS_DR_H
 #define _ZEBRA_ISIS_DR_H
 
-int isis_run_dr_l1(struct thread *thread);
-int isis_run_dr_l2(struct thread *thread);
+int isis_run_dr(struct thread *thread);
 int isis_dr_elect(struct isis_circuit *circuit, int level);
 int isis_dr_resign(struct isis_circuit *circuit, int level);
 int isis_dr_commence(struct isis_circuit *circuit, int level);
index 9f58c24b71be856585f10f5c091f1ff485ab4093..4da23c591261a1b98588830877a98149003d4d39 100644 (file)
@@ -77,47 +77,29 @@ void isis_event_circuit_state_change(struct isis_circuit *circuit,
 
 static void circuit_commence_level(struct isis_circuit *circuit, int level)
 {
-       if (level == 1) {
-               if (!circuit->is_passive)
+       if (!circuit->is_passive) {
+               if (level == 1) {
                        thread_add_timer(master, send_l1_psnp, circuit,
                                         isis_jitter(circuit->psnp_interval[0],
                                                     PSNP_JITTER),
                                         &circuit->t_send_psnp[0]);
-
-               if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
-                       thread_add_timer(master, isis_run_dr_l1, circuit,
-                                        2 * circuit->hello_interval[0],
-                                        &circuit->u.bc.t_run_dr[0]);
-
-                       thread_add_timer(master, send_lan_l1_hello, circuit,
-                                        isis_jitter(circuit->hello_interval[0],
-                                                    IIH_JITTER),
-                                        &circuit->u.bc.t_send_lan_hello[0]);
-
-                       circuit->u.bc.lan_neighs[0] = list_new();
-               }
-       } else {
-               if (!circuit->is_passive)
+               } else {
                        thread_add_timer(master, send_l2_psnp, circuit,
                                         isis_jitter(circuit->psnp_interval[1],
                                                     PSNP_JITTER),
                                         &circuit->t_send_psnp[1]);
-
-               if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
-                       thread_add_timer(master, isis_run_dr_l2, circuit,
-                                        2 * circuit->hello_interval[1],
-                                        &circuit->u.bc.t_run_dr[1]);
-
-                       thread_add_timer(master, send_lan_l2_hello, circuit,
-                                        isis_jitter(circuit->hello_interval[1],
-                                                    IIH_JITTER),
-                                        &circuit->u.bc.t_send_lan_hello[1]);
-
-                       circuit->u.bc.lan_neighs[1] = list_new();
                }
        }
 
-       return;
+       if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
+               thread_add_timer(master, isis_run_dr,
+                                &circuit->level_arg[level - 1],
+                                2 * circuit->hello_interval[level - 1],
+                                &circuit->u.bc.t_run_dr[level - 1]);
+
+               send_hello_sched(circuit, level, TRIGGERED_IIH_DELAY);
+               circuit->u.bc.lan_neighs[level - 1] = list_new();
+       }
 }
 
 static void circuit_resign_level(struct isis_circuit *circuit, int level)
index 2f18b98d3f2d6c9ba9f8a7fd9c76c341a4593d90..900ce9f922e9a6dd5bd08f92b3797a83929053f7 100644 (file)
@@ -1742,81 +1742,94 @@ int send_hello(struct isis_circuit *circuit, int level)
        return retval;
 }
 
-int send_lan_l1_hello(struct thread *thread)
+static int send_hello_cb(struct thread *thread)
 {
-       struct isis_circuit *circuit;
-       int retval;
+       struct isis_circuit_arg *arg = THREAD_ARG(thread);
+       
+       assert(arg);
+       
+       struct isis_circuit *circuit = arg->circuit;
+       int level = arg->level;
 
-       circuit = THREAD_ARG(thread);
        assert(circuit);
-       circuit->u.bc.t_send_lan_hello[0] = NULL;
 
-       if (!(circuit->area->is_type & IS_LEVEL_1)) {
-               zlog_warn(
-                       "ISIS-Hello (%s): Trying to send L1 IIH in L2-only area",
-                       circuit->area->area_tag);
-               return 1;
+       if (circuit->circ_type == CIRCUIT_T_P2P) {
+               circuit->u.p2p.t_send_p2p_hello = NULL;
+               send_hello(circuit, 1);
+               send_hello_sched(circuit, ISIS_LEVEL1,
+                                1000 * circuit->hello_interval[1]);
+               return ISIS_OK;
        }
 
-       if (circuit->u.bc.run_dr_elect[0])
-               isis_dr_elect(circuit, 1);
+       if (circuit->circ_type != CIRCUIT_T_BROADCAST) {
+               zlog_warn("ISIS-Hello (%s): Trying to send hello on unknown circuit type %d",
+                         circuit->area->area_tag, circuit->circ_type);
+               return ISIS_WARNING;
+       }
 
-       retval = send_hello(circuit, 1);
+       circuit->u.bc.t_send_lan_hello[level - 1] = NULL;
+       if (!(circuit->is_type & level)) {
+               zlog_warn("ISIS-Hello (%s): Trying to send L%d IIH in L%d-only circuit",
+                         circuit->area->area_tag, level, 3 - level);
+               return ISIS_WARNING;
+       }
 
-       /* set next timer thread */
-       thread_add_timer(master, send_lan_l1_hello, circuit,
-                        isis_jitter(circuit->hello_interval[0], IIH_JITTER),
-                        &circuit->u.bc.t_send_lan_hello[0]);
+       if (circuit->u.bc.run_dr_elect[level - 1])
+               isis_dr_elect(circuit, level);
 
-       return retval;
+       int rv = send_hello(circuit, level);
+
+       /* set next timer thread */
+       send_hello_sched(circuit, level, 1000 * circuit->hello_interval[level - 1]);
+       return rv;
 }
 
-int send_lan_l2_hello(struct thread *thread)
+static void _send_hello_sched(struct isis_circuit *circuit,
+                             struct thread **threadp,
+                             int level, long delay)
 {
-       struct isis_circuit *circuit;
-       int retval;
-
-       circuit = THREAD_ARG(thread);
-       assert(circuit);
-       circuit->u.bc.t_send_lan_hello[1] = NULL;
+       if (*threadp) {
+               if (thread_timer_remain_msec(*threadp) < (unsigned long)delay)
+                       return;
 
-       if (!(circuit->area->is_type & IS_LEVEL_2)) {
-               zlog_warn("ISIS-Hello (%s): Trying to send L2 IIH in L1 area",
-                         circuit->area->area_tag);
-               return 1;
+               thread_cancel(*threadp);
        }
 
-       if (circuit->u.bc.run_dr_elect[1])
-               isis_dr_elect(circuit, 2);
-
-       retval = send_hello(circuit, 2);
-
-       /* set next timer thread */
-       thread_add_timer(master, send_lan_l2_hello, circuit,
-                        isis_jitter(circuit->hello_interval[1], IIH_JITTER),
-                        &circuit->u.bc.t_send_lan_hello[1]);
-
-       return retval;
+       thread_add_timer_msec(master, send_hello_cb,
+                             &circuit->level_arg[level - 1],
+                             isis_jitter(delay, IIH_JITTER),
+                             threadp);
 }
 
-int send_p2p_hello(struct thread *thread)
+void send_hello_sched(struct isis_circuit *circuit, int level, long delay)
 {
-       struct isis_circuit *circuit;
-
-       circuit = THREAD_ARG(thread);
-       assert(circuit);
-       circuit->u.p2p.t_send_p2p_hello = NULL;
+       if (circuit->circ_type == CIRCUIT_T_P2P) {
+               _send_hello_sched(circuit, &circuit->u.p2p.t_send_p2p_hello,
+                                 ISIS_LEVEL1, delay);
+               return;
+       }
 
-       send_hello(circuit, 1);
+       if (circuit->circ_type != CIRCUIT_T_BROADCAST) {
+               zlog_warn("%s: encountered unknown circuit type %d on %s",
+                         __func__, circuit->circ_type,
+                         circuit->interface->name);
+               return;
+       }
 
-       /* set next timer thread */
-       thread_add_timer(master, send_p2p_hello, circuit,
-                        isis_jitter(circuit->hello_interval[1], IIH_JITTER),
-                        &circuit->u.p2p.t_send_p2p_hello);
+       for (int loop_level = ISIS_LEVEL1; loop_level <= ISIS_LEVEL2; loop_level++) {
+               if (!(loop_level & level))
+                       continue;
 
-       return ISIS_OK;
+               _send_hello_sched(
+                       circuit,
+                       &circuit->u.bc.t_send_lan_hello[loop_level - 1],
+                       loop_level,
+                       delay
+               );
+       }
 }
 
+
 /*
  * Count the maximum number of lsps that can be accomodated by a given size.
  */
index 3d2420eb036abf340f7459c8e93b2215fd5ad509..0fa3b2c7ab06a40a83faaaa76aa5551746739dca 100644 (file)
@@ -208,9 +208,7 @@ int isis_receive(struct thread *thread);
 /*
  * Sending functions
  */
-int send_lan_l1_hello(struct thread *thread);
-int send_lan_l2_hello(struct thread *thread);
-int send_p2p_hello(struct thread *thread);
+void send_hello_sched(struct isis_circuit *circuit, int level, long delay);
 int send_csnp(struct isis_circuit *circuit, int level);
 int send_l1_csnp(struct thread *thread);
 int send_l2_csnp(struct thread *thread);
index d104c4f5988cb46721f49441f7af21ce64a85333..44c9e2b2f1689d93af58cadd431e4b123fb2709b 100644 (file)
@@ -655,20 +655,26 @@ void thread_master_free(struct thread_master *m)
        XFREE(MTYPE_THREAD_MASTER, m);
 }
 
-/* Return remain time in second. */
-unsigned long thread_timer_remain_second(struct thread *thread)
+/* Return remain time in miliseconds. */
+unsigned long thread_timer_remain_msec(struct thread *thread)
 {
        int64_t remain;
 
        pthread_mutex_lock(&thread->mtx);
        {
-               remain = monotime_until(&thread->u.sands, NULL) / 1000000LL;
+               remain = monotime_until(&thread->u.sands, NULL) / 1000LL;
        }
        pthread_mutex_unlock(&thread->mtx);
 
        return remain < 0 ? 0 : remain;
 }
 
+/* Return remain time in seconds. */
+unsigned long thread_timer_remain_second(struct thread *thread)
+{
+       return thread_timer_remain_msec(thread) / 1000LL;
+}
+
 #define debugargdef  const char *funcname, const char *schedfrom, int fromln
 #define debugargpass funcname, schedfrom, fromln
 
index 4de9a65562ab13895c760325d06e278e52bc7421..f404d92755e6b82a28671259b5f2e821c75a3385 100644 (file)
@@ -217,6 +217,7 @@ extern struct thread *thread_fetch(struct thread_master *, struct thread *);
 extern void thread_call(struct thread *);
 extern unsigned long thread_timer_remain_second(struct thread *);
 extern struct timeval thread_timer_remain(struct thread *);
+extern unsigned long thread_timer_remain_msec(struct thread *);
 extern int thread_should_yield(struct thread *);
 /* set yield time for thread */
 extern void thread_set_yield_time(struct thread *, unsigned long);
index 990821d29d7c2c609c1b754426c255cf03d636af..ee7dba3692599d686c303c9aa9379d0cbd3fea04 100644 (file)
@@ -1,4 +1,7 @@
 hostname r1
+debug isis adj-packets
+debug isis events
+debug isis update-packets
 interface r1-eth0
  ip router isis 1
  ipv6 router isis 1
index bcccc0882563fc5e3d8388d9a5d5d85f16e99fe3..f6fee6c84560ab8658e4a26672b2b20385fba250 100644 (file)
@@ -1,4 +1,7 @@
 hostname r2
+debug isis adj-packets
+debug isis events
+debug isis update-packets
 interface r2-eth0
  ip router isis 1
  ipv6 router isis 1
index c3c3e5001a203e3cf54fbb1954950eae588b5a94..4ae56b4af4364ce784291ffecf905b7b52be71ca 100644 (file)
@@ -1,4 +1,7 @@
 hostname r3
+debug isis adj-packets
+debug isis events
+debug isis update-packets
 interface r3-eth0
  ip router isis 1
  ipv6 router isis 1
index 405802ed597a00558ae2b401720d728b2adfa6ee..bf9653387ec995211b40574a093561545a00ad37 100644 (file)
@@ -1,4 +1,7 @@
 hostname r4
+debug isis adj-packets
+debug isis events
+debug isis update-packets
 interface r4-eth0
  ip router isis 1
  ipv6 router isis 1
index 0a8f325331fb46df419723c172386cfbb778a87e..5a044988a95d0b8c578ef6127682b14d3e31a2f6 100644 (file)
@@ -1,4 +1,7 @@
 hostname r5
+debug isis adj-packets
+debug isis events
+debug isis update-packets
 interface r5-eth0
  ip router isis 1
  ipv6 router isis 1
index 1bdf8b10d0aadd2e930d5c8b534d9e3b1ad61e1a..f25b066288710c3fc91d19aff05e54826797c2d2 100644 (file)
@@ -60,6 +60,9 @@ class json_cmp_result(object):
         "Returns True if there were errors, otherwise False."
         return len(self.errors) > 0
 
+    def __str__(self):
+        return '\n'.join(self.errors)
+
 def get_test_logdir(node=None, init=False):
     """
     Return the current test log directory based on PYTEST_CURRENT_TEST