]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #12698 from Orange-OpenSource/isisd
authorRuss White <russ@riw.us>
Tue, 11 Apr 2023 13:49:01 +0000 (09:49 -0400)
committerGitHub <noreply@github.com>
Tue, 11 Apr 2023 13:49:01 +0000 (09:49 -0400)
Isisd/Lib: Add new printfrr format facility for Intermediate System ID

19 files changed:
1  2 
doc/developer/logging.rst
isisd/fabricd.c
isisd/isis_adjacency.c
isisd/isis_adjacency.h
isisd/isis_circuit.c
isisd/isis_dynhn.c
isisd/isis_events.c
isisd/isis_lfa.c
isisd/isis_lsp.c
isisd/isis_pdu.c
isisd/isis_snmp.c
isisd/isis_spf.c
isisd/isis_sr.c
isisd/isis_te.c
isisd/isis_tx_queue.c
isisd/isisd.c
isisd/isisd.h
lib/link_state.c
lib/subdir.am

index b7021b69a12acd8f63294daffa9ca0d1545ca5a8,231ef37d45afe875ea9f88e5a8670c795335ee57..2fe0a5989b94d8a81612fb3ac1a49cb39653d50f
@@@ -335,16 -335,16 +335,16 @@@ Time/interval format
  FRR library helper formats
  ^^^^^^^^^^^^^^^^^^^^^^^^^^
  
 -.. frrfmt:: %pTH (struct thread *)
 +.. frrfmt:: %pTH (struct event *)
  
 -   Print remaining time on timer thread. Interval-printing flag characters
 +   Print remaining time on timer event. Interval-printing flag characters
     listed above for ``%pTV`` can be added, e.g. ``%pTHtx``.
  
     ``NULL`` pointers are printed as ``-``.
  
 -.. frrfmt:: %pTHD (struct thread *)
 +.. frrfmt:: %pTHD (struct event *)
  
 -   Print debugging information for given thread.  Sample output:
 +   Print debugging information for given event.  Sample output:
  
     .. code-block:: none
  
@@@ -502,6 -502,51 +502,51 @@@ General utility format
     representation for a hexdump.  Non-printable characters are replaced with
     a dot.
  
+ .. frrfmt:: %pIS (struct iso_address *)
+    ([IS]o Network address) - Format ISO Network Address
+    ``%pIS``: :frrfmtout:`01.0203.04O5`
+    ISO Network address is printed as separated byte. The number of byte of the
+    address is embeded in the `iso_net` structure.
+    ``%pISl``: :frrfmtout:`01.0203.04O5.0607.0809.1011.1213.14` - long format to
+    print the long version of the ISO Network address which include the System
+    ID and the PSEUDO-ID of the IS-IS system
+    Note that the `ISO_ADDR_STRLEN` define gives the total size of the string
+    that could be used in conjunction to snprintfrr. Use like::
+      char buf[ISO_ADDR_STRLEN];
+      struct iso_net addr = {.len = 4, .addr = {1, 2, 3, 4}};
+      snprintfrr(buf, ISO_ADDR_STRLEN, "%pIS", &addr);
+ .. frrfmt:: %pSY (uint8_t *)
+    (IS-IS [SY]stem ID) - Format IS-IS System ID
+    ``%pSY``: :frrfmtout:`0102.0304.0506`
+ .. frrfmt:: %pPN (uint8_t *)
+    (IS-IS [P]seudo [N]ode System ID) - Format IS-IS Pseudo Node System ID
+    ``%pPN``: :frrfmtout:`0102.0304.0506.07`
+ .. frrfmt:: %pLS (uint8_t *)
+    (IS-IS [L]sp fragment [S]ystem ID) - Format IS-IS Pseudo System ID
+    ``%pLS``: :frrfmtout:`0102.0304.0506.07-08`
+    Note that the `ISO_SYSID_STRLEN` define gives the total size of the string
+    that could be used in conjunction to snprintfrr. Use like::
+      char buf[ISO_SYSID_STRLEN];
+      uint8_t id[8] = {1, 2, 3, 4 , 5 , 6 , 7, 8};
+      snprintfrr(buf, SYS_ID_SIZE, "%pSY", id);
  Integer formats
  ^^^^^^^^^^^^^^^
  
diff --combined isisd/fabricd.c
index 4fd39498a0bd57024c794b48bf6804addad2f782,d8b9c1007581f18be3276f07652477a399449867..0be36e175ac49602a83f40b4dfbbfe0be122e439
@@@ -40,7 -40,7 +40,7 @@@ struct fabricd 
        enum fabricd_sync_state initial_sync_state;
        time_t initial_sync_start;
        struct isis_circuit *initial_sync_circuit;
 -      struct thread *initial_sync_timeout;
 +      struct event *initial_sync_timeout;
  
        struct isis_spftree *spftree;
        struct skiplist *neighbors;
@@@ -49,8 -49,8 +49,8 @@@
        uint8_t tier;
        uint8_t tier_config;
        uint8_t tier_pending;
 -      struct thread *tier_calculation_timer;
 -      struct thread *tier_set_timer;
 +      struct event *tier_calculation_timer;
 +      struct event *tier_set_timer;
  
        int csnp_delay;
        bool always_send_csnp;
@@@ -225,11 -225,11 +225,11 @@@ struct fabricd *fabricd_new(struct isis
  
  void fabricd_finish(struct fabricd *f)
  {
 -      THREAD_OFF(f->initial_sync_timeout);
 +      EVENT_OFF(f->initial_sync_timeout);
  
 -      THREAD_OFF(f->tier_calculation_timer);
 +      EVENT_OFF(f->tier_calculation_timer);
  
 -      THREAD_OFF(f->tier_set_timer);
 +      EVENT_OFF(f->tier_set_timer);
  
        isis_spftree_del(f->spftree);
        neighbor_lists_clear(f);
        hash_free(f->neighbors_neighbors);
  }
  
 -static void fabricd_initial_sync_timeout(struct thread *thread)
 +static void fabricd_initial_sync_timeout(struct event *thread)
  {
 -      struct fabricd *f = THREAD_ARG(thread);
 +      struct fabricd *f = EVENT_ARG(thread);
  
        if (IS_DEBUG_ADJ_PACKETS)
                zlog_debug(
@@@ -267,14 -267,14 +267,14 @@@ void fabricd_initial_sync_hello(struct 
        if (f->initial_sync_timeout)
                return;
  
 -      thread_add_timer(master, fabricd_initial_sync_timeout, f,
 -                       timeout, &f->initial_sync_timeout);
 +      event_add_timer(master, fabricd_initial_sync_timeout, f, timeout,
 +                      &f->initial_sync_timeout);
        f->initial_sync_start = monotime(NULL);
  
        if (IS_DEBUG_ADJ_PACKETS)
                zlog_debug(
-                       "OpenFabric: Started initial synchronization with %s on %s",
-                       sysid_print(circuit->u.p2p.neighbor->sysid),
+                       "OpenFabric: Started initial synchronization with %pSY on %s",
+                       circuit->u.p2p.neighbor->sysid,
                        circuit->interface->name);
  }
  
@@@ -325,7 -325,7 +325,7 @@@ void fabricd_initial_sync_finish(struc
                  f->initial_sync_circuit->interface->name);
        f->initial_sync_state = FABRICD_SYNC_COMPLETE;
        f->initial_sync_circuit = NULL;
 -      THREAD_OFF(f->initial_sync_timeout);
 +      EVENT_OFF(f->initial_sync_timeout);
  }
  
  static void fabricd_bump_tier_calculation_timer(struct fabricd *f);
@@@ -359,7 -359,9 +359,9 @@@ static uint8_t fabricd_calculate_fabric
                return ISIS_TIER_UNDEFINED;
        }
  
-       zlog_info("OpenFabric: Found %s as furthest t0 from local system, dist == %u", rawlspid_print(furthest_t0->N.id), furthest_t0->d_N);
+       zlog_info(
+               "OpenFabric: Found %pLS as furthest t0 from local system, dist == %u",
+               furthest_t0->N.id, furthest_t0->d_N);
  
        struct isis_spftree *remote_tree =
                isis_run_hopcount_spf(area, furthest_t0->N.id, NULL);
                isis_spftree_del(remote_tree);
                return ISIS_TIER_UNDEFINED;
        } else {
-               zlog_info("OpenFabric: Found %s as furthest from remote dist == %u", rawlspid_print(furthest_from_remote->N.id),
-                         furthest_from_remote->d_N);
+               zlog_info(
+                       "OpenFabric: Found %pLS as furthest from remote dist == %u",
+                       furthest_from_remote->N.id, furthest_from_remote->d_N);
        }
  
        int64_t tier = furthest_from_remote->d_N - furthest_t0->d_N;
        return tier;
  }
  
 -static void fabricd_tier_set_timer(struct thread *thread)
 +static void fabricd_tier_set_timer(struct event *thread)
  {
 -      struct fabricd *f = THREAD_ARG(thread);
 +      struct fabricd *f = EVENT_ARG(thread);
  
        fabricd_set_tier(f, f->tier_pending);
  }
  
 -static void fabricd_tier_calculation_cb(struct thread *thread)
 +static void fabricd_tier_calculation_cb(struct event *thread)
  {
 -      struct fabricd *f = THREAD_ARG(thread);
 +      struct fabricd *f = EVENT_ARG(thread);
        uint8_t tier = ISIS_TIER_UNDEFINED;
  
        tier = fabricd_calculate_fabric_tier(f->area);
        zlog_info("OpenFabric: Got tier %hhu from algorithm. Arming timer.",
                  tier);
        f->tier_pending = tier;
 -      thread_add_timer(master, fabricd_tier_set_timer, f,
 -                       f->area->lsp_gen_interval[ISIS_LEVEL2 - 1],
 -                       &f->tier_set_timer);
 -
 +      event_add_timer(master, fabricd_tier_set_timer, f,
 +                      f->area->lsp_gen_interval[ISIS_LEVEL2 - 1],
 +                      &f->tier_set_timer);
  }
  
  static void fabricd_bump_tier_calculation_timer(struct fabricd *f)
  {
        /* Cancel timer if we already know our tier */
        if (f->tier != ISIS_TIER_UNDEFINED || f->tier_set_timer) {
 -              THREAD_OFF(f->tier_calculation_timer);
 +              EVENT_OFF(f->tier_calculation_timer);
                return;
        }
  
        /* If we need to calculate the tier, wait some
         * time for the topology to settle before running
         * the calculation */
 -      THREAD_OFF(f->tier_calculation_timer);
 +      EVENT_OFF(f->tier_calculation_timer);
  
 -      thread_add_timer(master, fabricd_tier_calculation_cb, f,
 -                       2 * f->area->lsp_gen_interval[ISIS_LEVEL2 - 1],
 -                       &f->tier_calculation_timer);
 +      event_add_timer(master, fabricd_tier_calculation_cb, f,
 +                      2 * f->area->lsp_gen_interval[ISIS_LEVEL2 - 1],
 +                      &f->tier_calculation_timer);
  }
  
  static void fabricd_set_tier(struct fabricd *f, uint8_t tier)
@@@ -709,10 -713,10 +712,10 @@@ void fabricd_trigger_csnp(struct isis_a
                if (!circuit->t_send_csnp[1])
                        continue;
  
 -              THREAD_OFF(circuit->t_send_csnp[ISIS_LEVEL2 - 1]);
 -              thread_add_timer_msec(master, send_l2_csnp, circuit,
 -                                    isis_jitter(f->csnp_delay, CSNP_JITTER),
 -                                    &circuit->t_send_csnp[ISIS_LEVEL2 - 1]);
 +              EVENT_OFF(circuit->t_send_csnp[ISIS_LEVEL2 - 1]);
 +              event_add_timer_msec(master, send_l2_csnp, circuit,
 +                                   isis_jitter(f->csnp_delay, CSNP_JITTER),
 +                                   &circuit->t_send_csnp[ISIS_LEVEL2 - 1]);
        }
  }
  
diff --combined isisd/isis_adjacency.c
index 1871078cc165734824784f9b484099a0e73796da,5e168e05553f0e4cb58ac215636527300ba4889f..30b71537e0e5ea2062e426062c77f9bf3b718abc
@@@ -15,7 -15,7 +15,7 @@@
  #include "hash.h"
  #include "vty.h"
  #include "linklist.h"
 -#include "thread.h"
 +#include "frrevent.h"
  #include "if.h"
  #include "stream.h"
  #include "bfd.h"
@@@ -148,7 -148,7 +148,7 @@@ void isis_delete_adj(void *arg
        /* Remove self from snmp list without walking the list*/
        list_delete_node(adj->circuit->snmp_adj_list, adj->snmp_list_node);
  
 -      THREAD_OFF(adj->t_expire);
 +      EVENT_OFF(adj->t_expire);
        if (adj->adj_state != ISIS_ADJ_DOWN)
                adj->adj_state = ISIS_ADJ_DOWN;
  
@@@ -283,6 -283,8 +283,8 @@@ void isis_adj_process_threeway(struct i
  }
  const char *isis_adj_name(const struct isis_adjacency *adj)
  {
+       static char buf[ISO_SYSID_STRLEN];
        if (!adj)
                return "NONE";
  
        dyn = dynhn_find_by_id(adj->circuit->isis, adj->sysid);
        if (dyn)
                return dyn->hostname;
-       else
-               return sysid_print(adj->sysid);
+       snprintfrr(buf, sizeof(buf), "%pSY", adj->sysid);
+       return buf;
  }
  void isis_log_adj_change(struct isis_adjacency *adj,
                         enum isis_adj_state old_state,
@@@ -396,13 -399,13 +399,13 @@@ void isis_adj_state_change(struct isis_
                                adj->flaps++;
  
                                if (level == IS_LEVEL_1) {
 -                                      thread_add_timer(master, send_l1_csnp,
 -                                                       circuit, 0,
 -                                                       &circuit->t_send_csnp[0]);
 +                                      event_add_timer(
 +                                              master, send_l1_csnp, circuit,
 +                                              0, &circuit->t_send_csnp[0]);
                                } else {
 -                                      thread_add_timer(master, send_l2_csnp,
 -                                                       circuit, 0,
 -                                                       &circuit->t_send_csnp[1]);
 +                                      event_add_timer(
 +                                              master, send_l2_csnp, circuit,
 +                                              0, &circuit->t_send_csnp[1]);
                                }
                        } else if (old_state == ISIS_ADJ_UP) {
                                circuit->upadjcount[level - 1]--;
@@@ -439,9 -442,8 +442,8 @@@ void isis_adj_print(struct isis_adjacen
        if (dyn)
                zlog_debug("%s", dyn->hostname);
  
-       zlog_debug("SystemId %20s SNPA %s, level %d; Holding Time %d",
-                  sysid_print(adj->sysid), snpa_print(adj->snpa), adj->level,
-                  adj->hold_time);
+       zlog_debug("SystemId %20pSY SNPA %pSY, level %d; Holding Time %d",
+                  adj->sysid, adj->snpa, adj->level, adj->hold_time);
        if (adj->ipv4_address_count) {
                zlog_debug("IPv4 Address(es):");
                for (unsigned int i = 0; i < adj->ipv4_address_count; i++)
@@@ -478,14 -480,14 +480,14 @@@ const char *isis_adj_yang_state(enum is
        assert(!"Reached end of function where we are not expecting to");
  }
  
 -void isis_adj_expire(struct thread *thread)
 +void isis_adj_expire(struct event *thread)
  {
        struct isis_adjacency *adj;
  
        /*
         * Get the adjacency
         */
 -      adj = THREAD_ARG(thread);
 +      adj = EVENT_ARG(thread);
        assert(adj);
        adj->t_expire = NULL;
  
@@@ -530,7 -532,7 +532,7 @@@ void isis_adj_print_json(struct isis_ad
                                        time2string(adj->last_upd +
                                                    adj->hold_time - now));
                }
-               json_object_string_add(json, "snpa", snpa_print(adj->snpa));
+               json_object_string_addf(json, "snpa", "%pSY", adj->snpa);
        }
  
        if (detail == ISIS_UI_LEVEL_DETAIL) {
                                        isis_mtid2str(adj->mt_set[i]));
                        }
                }
-               json_object_string_add(iface_json, "snpa",
-                                      snpa_print(adj->snpa));
+               json_object_string_addf(iface_json, "snpa", "%pSY", adj->snpa);
                if (adj->circuit &&
                    (adj->circuit->circ_type == CIRCUIT_T_BROADCAST)) {
                        dyn = dynhn_find_by_id(adj->circuit->isis, adj->lanid);
                                json_object_string_add(iface_json, "lan-id",
                                                       buf);
                        } else {
-                               snprintfrr(buf, sizeof(buf), "%s-%02x",
-                                          sysid_print(adj->lanid),
-                                          adj->lanid[ISIS_SYS_ID_LEN]);
-                               json_object_string_add(iface_json, "lan-id",
-                                                      buf);
+                               json_object_string_addf(iface_json, "lan-id",
+                                                       "%pSY", adj->lanid);
                        }
  
                        json_object_int_add(iface_json, "lan-prio",
                                               area_addr_json);
                        for (unsigned int i = 0; i < adj->area_address_count;
                             i++) {
-                               json_object_string_add(
-                                       area_addr_json, "isonet",
-                                       isonet_print(adj->area_addresses[i]
-                                                            .area_addr,
-                                                    adj->area_addresses[i]
-                                                            .addr_len));
+                               json_object_string_addf(
+                                       area_addr_json, "isonet", "%pIS",
+                                       &adj->area_addresses[i]);
                        }
                }
                if (adj->ipv4_address_count) {
@@@ -736,7 -731,7 +731,7 @@@ void isis_adj_print_vty(struct isis_adj
                                                + adj->hold_time - now);
                } else
                        vty_out(vty, "-        ");
-               vty_out(vty, "%-10s", snpa_print(adj->snpa));
+               vty_out(vty, "%-10pSY", adj->snpa);
                vty_out(vty, "\n");
        }
  
                                vty_out(vty, "      %s\n",
                                        isis_mtid2str(adj->mt_set[i]));
                }
-               vty_out(vty, "    SNPA: %s", snpa_print(adj->snpa));
+               vty_out(vty, "    SNPA: %pSY", adj->snpa);
                if (adj->circuit
                    && (adj->circuit->circ_type == CIRCUIT_T_BROADCAST)) {
                        dyn = dynhn_find_by_id(adj->circuit->isis, adj->lanid);
                                vty_out(vty, ", LAN id: %s.%02x", dyn->hostname,
                                        adj->lanid[ISIS_SYS_ID_LEN]);
                        else
-                               vty_out(vty, ", LAN id: %s.%02x",
-                                       sysid_print(adj->lanid),
-                                       adj->lanid[ISIS_SYS_ID_LEN]);
+                               vty_out(vty, ", LAN id: %pPN", adj->lanid);
  
                        vty_out(vty, "\n");
                        vty_out(vty, "    LAN Priority: %u",
                        vty_out(vty, "    Area Address(es):\n");
                        for (unsigned int i = 0; i < adj->area_address_count;
                             i++) {
-                               vty_out(vty, "      %s\n",
-                                       isonet_print(adj->area_addresses[i]
-                                                            .area_addr,
-                                                    adj->area_addresses[i]
-                                                            .addr_len));
+                               vty_out(vty, "      %pIS\n",
+                                       &adj->area_addresses[i]);
                        }
                }
                if (adj->ipv4_address_count) {
diff --combined isisd/isis_adjacency.h
index f02f7a68eac6a9c6a3e793adf7fe974dce2c6052,ab4c8038ee176a9d770333b6f3a612173609b8ca..c0c8e68145d2633946169be5c949e3b5ecf07612
@@@ -69,7 -69,7 +69,7 @@@ struct isis_adjacency 
        struct isis_dis_record dis_record[DIS_RECORDS * ISIS_LEVELS];
        enum isis_adj_state adj_state;    /* adjacencyState */
        enum isis_adj_usage adj_usage;    /* adjacencyUsage */
-       struct area_addr *area_addresses; /* areaAdressesOfNeighbour */
+       struct iso_address *area_addresses; /* areaAdressesOfNeighbour */
        unsigned int area_address_count;
        struct nlpids nlpids; /* protocols spoken ... */
        struct in_addr *ipv4_addresses;
@@@ -90,7 -90,7 +90,7 @@@
        enum isis_threeway_state threeway_state;
        uint32_t ext_circuit_id;
        int flaps;                    /* number of adjacency flaps  */
 -      struct thread *t_expire;      /* expire after hold_time  */
 +      struct event *t_expire;       /* expire after hold_time  */
        struct isis_circuit *circuit; /* back pointer */
        uint16_t *mt_set;      /* Topologies this adjacency is valid for */
        unsigned int mt_count; /* Number of entries in mt_set */
@@@ -128,7 -128,7 +128,7 @@@ void isis_adj_state_change(struct isis_
                           enum isis_adj_state state, const char *reason);
  void isis_adj_print(struct isis_adjacency *adj);
  const char *isis_adj_yang_state(enum isis_adj_state state);
 -void isis_adj_expire(struct thread *thread);
 +void isis_adj_expire(struct event *thread);
  void isis_adj_print_vty(struct isis_adjacency *adj, struct vty *vty,
                        char detail);
  void isis_adj_print_json(struct isis_adjacency *adj, struct json_object *json,
  void isis_adj_build_neigh_list(struct list *adjdb, struct list *list);
  void isis_adj_build_up_list(struct list *adjdb, struct list *list);
  int isis_adj_usage2levels(enum isis_adj_usage usage);
 -void isis_bfd_startup_timer(struct thread *thread);
 +void isis_bfd_startup_timer(struct event *thread);
  const char *isis_adj_name(const struct isis_adjacency *adj);
  #endif /* ISIS_ADJACENCY_H */
diff --combined isisd/isis_circuit.c
index 64b405737f0f896130684763a2f7b89cbdbf24c0,fef553800a87b6a5e6957682500d9d399bfa9148..feab45123383e3027376080b57b446bb43f042d0
@@@ -19,7 -19,7 +19,7 @@@
  #include "if.h"
  #include "linklist.h"
  #include "command.h"
 -#include "thread.h"
 +#include "frrevent.h"
  #include "vty.h"
  #include "hash.h"
  #include "prefix.h"
@@@ -286,7 -286,8 +286,7 @@@ void isis_circuit_add_addr(struct isis_
        if (connected->address->family == AF_INET) {
                uint32_t addr = connected->address->u.prefix4.s_addr;
                addr = ntohl(addr);
 -              if (IPV4_NET0(addr) || IPV4_NET127(addr) || IN_CLASSD(addr)
 -                  || IPV4_LINKLOCAL(addr))
 +              if (IPV4_NET0(addr) || IPV4_NET127(addr) || IN_CLASSD(addr))
                        return;
  
                for (ALL_LIST_ELEMENTS_RO(circuit->ip_addrs, node, ipv4))
@@@ -626,12 -627,12 +626,12 @@@ void isis_circuit_stream(struct isis_ci
  void isis_circuit_prepare(struct isis_circuit *circuit)
  {
  #if ISIS_METHOD != ISIS_METHOD_DLPI
 -      thread_add_read(master, isis_receive, circuit, circuit->fd,
 -                      &circuit->t_read);
 +      event_add_read(master, isis_receive, circuit, circuit->fd,
 +                     &circuit->t_read);
  #else
 -      thread_add_timer_msec(master, isis_receive, circuit,
 -                            listcount(circuit->area->circuit_list) * 100,
 -                            &circuit->t_read);
 +      event_add_timer_msec(master, isis_receive, circuit,
 +                           listcount(circuit->area->circuit_list) * 100,
 +                           &circuit->t_read);
  #endif
  }
  
@@@ -695,10 -696,9 +695,9 @@@ int isis_circuit_up(struct isis_circui
                }
  #ifdef EXTREME_DEGUG
                if (IS_DEBUG_EVENTS)
-                       zlog_debug("%s: if_id %d, isomtu %d snpa %s", __func__,
-                                  circuit->interface->ifindex,
-                                  ISO_MTU(circuit),
-                                  snpa_print(circuit->u.bc.snpa));
+                       zlog_debug("%s: if_id %d, isomtu %d snpa %pSY",
+                                  __func__, circuit->interface->ifindex,
+                                  ISO_MTU(circuit), circuit->u.bc.snpa);
  #endif /* EXTREME_DEBUG */
  
                circuit->u.bc.adjdb[0] = 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]);
 +                      event_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 */
  
        /* initializing PSNP timers */
        if (circuit->is_type & IS_LEVEL_1)
 -              thread_add_timer(
 +              event_add_timer(
                        master, send_l1_psnp, circuit,
                        isis_jitter(circuit->psnp_interval[0], PSNP_JITTER),
                        &circuit->t_send_psnp[0]);
  
        if (circuit->is_type & IS_LEVEL_2)
 -              thread_add_timer(
 +              event_add_timer(
                        master, send_l2_psnp, circuit,
                        isis_jitter(circuit->psnp_interval[1], PSNP_JITTER),
                        &circuit->t_send_psnp[1]);
@@@ -862,12 -862,12 +861,12 @@@ void isis_circuit_down(struct isis_circ
                memset(circuit->u.bc.l2_desig_is, 0, ISIS_SYS_ID_LEN + 1);
                memset(circuit->u.bc.snpa, 0, ETH_ALEN);
  
 -              THREAD_OFF(circuit->u.bc.t_send_lan_hello[0]);
 -              THREAD_OFF(circuit->u.bc.t_send_lan_hello[1]);
 -              THREAD_OFF(circuit->u.bc.t_run_dr[0]);
 -              THREAD_OFF(circuit->u.bc.t_run_dr[1]);
 -              THREAD_OFF(circuit->u.bc.t_refresh_pseudo_lsp[0]);
 -              THREAD_OFF(circuit->u.bc.t_refresh_pseudo_lsp[1]);
 +              EVENT_OFF(circuit->u.bc.t_send_lan_hello[0]);
 +              EVENT_OFF(circuit->u.bc.t_send_lan_hello[1]);
 +              EVENT_OFF(circuit->u.bc.t_run_dr[0]);
 +              EVENT_OFF(circuit->u.bc.t_run_dr[1]);
 +              EVENT_OFF(circuit->u.bc.t_refresh_pseudo_lsp[0]);
 +              EVENT_OFF(circuit->u.bc.t_refresh_pseudo_lsp[1]);
                circuit->lsp_regenerate_pending[0] = 0;
                circuit->lsp_regenerate_pending[1] = 0;
  
        } else if (circuit->circ_type == CIRCUIT_T_P2P) {
                isis_delete_adj(circuit->u.p2p.neighbor);
                circuit->u.p2p.neighbor = NULL;
 -              THREAD_OFF(circuit->u.p2p.t_send_p2p_hello);
 +              EVENT_OFF(circuit->u.p2p.t_send_p2p_hello);
        }
  
        /*
        circuit->snmp_adj_idx_gen = 0;
  
        /* Cancel all active threads */
 -      THREAD_OFF(circuit->t_send_csnp[0]);
 -      THREAD_OFF(circuit->t_send_csnp[1]);
 -      THREAD_OFF(circuit->t_send_psnp[0]);
 -      THREAD_OFF(circuit->t_send_psnp[1]);
 -      THREAD_OFF(circuit->t_read);
 +      EVENT_OFF(circuit->t_send_csnp[0]);
 +      EVENT_OFF(circuit->t_send_csnp[1]);
 +      EVENT_OFF(circuit->t_send_psnp[0]);
 +      EVENT_OFF(circuit->t_send_psnp[1]);
 +      EVENT_OFF(circuit->t_read);
  
        if (circuit->tx_queue) {
                isis_tx_queue_free(circuit->tx_queue);
                circuit->snd_stream = NULL;
        }
  
 -      thread_cancel_event(master, circuit);
 +      event_cancel_event(master, circuit);
  
        return;
  }
@@@ -995,8 -995,8 +994,8 @@@ void isis_circuit_print_json(struct isi
                json_object_string_add(iface_json, "level",
                                       circuit_t2string(circuit->is_type));
                if (circuit->circ_type == CIRCUIT_T_BROADCAST)
-                       json_object_string_add(iface_json, "snpa",
-                                              snpa_print(circuit->u.bc.snpa));
+                       json_object_string_addf(iface_json, "snpa", "%pSY",
+                                               circuit->u.bc.snpa);
  
  
                levels_json = json_object_new_array();
@@@ -1122,8 -1122,7 +1121,7 @@@ void isis_circuit_print_vty(struct isis
                        circuit_type2string(circuit->circ_type));
                vty_out(vty, ", Level: %s", circuit_t2string(circuit->is_type));
                if (circuit->circ_type == CIRCUIT_T_BROADCAST)
-                       vty_out(vty, ", SNPA: %-10s",
-                               snpa_print(circuit->u.bc.snpa));
+                       vty_out(vty, ", SNPA: %-10pSY", circuit->u.bc.snpa);
                vty_out(vty, "\n");
                if (circuit->is_type & IS_LEVEL_1) {
                        vty_out(vty, "    Level-1 Information:\n");
diff --combined isisd/isis_dynhn.c
index 446e52201998c3068aae4bce3c2078c4c225b728,ea33ffd3c40cdf832945a7812948acbbe4cd112a..61c49d08a742af88b924940594941561ffba9bd8
@@@ -16,7 -16,7 +16,7 @@@
  #include "stream.h"
  #include "command.h"
  #include "if.h"
 -#include "thread.h"
 +#include "frrevent.h"
  
  #include "isisd/isis_constants.h"
  #include "isisd/isis_common.h"
  
  DEFINE_MTYPE_STATIC(ISISD, ISIS_DYNHN, "ISIS dyn hostname");
  
 -static void dyn_cache_cleanup(struct thread *);
 +static void dyn_cache_cleanup(struct event *);
  
  void dyn_cache_init(struct isis *isis)
  {
        isis->dyn_cache = list_new();
        if (!CHECK_FLAG(im->options, F_ISIS_UNIT_TEST))
 -              thread_add_timer(master, dyn_cache_cleanup, isis, 120,
 -                               &isis->t_dync_clean);
 +              event_add_timer(master, dyn_cache_cleanup, isis, 120,
 +                              &isis->t_dync_clean);
  }
  
  void dyn_cache_finish(struct isis *isis)
@@@ -44,7 -44,7 +44,7 @@@
        struct listnode *node, *nnode;
        struct isis_dynhn *dyn;
  
 -      THREAD_OFF(isis->t_dync_clean);
 +      EVENT_OFF(isis->t_dync_clean);
  
        for (ALL_LIST_ELEMENTS(isis->dyn_cache, node, nnode, dyn)) {
                list_delete_node(isis->dyn_cache, node);
        list_delete(&isis->dyn_cache);
  }
  
 -static void dyn_cache_cleanup(struct thread *thread)
 +static void dyn_cache_cleanup(struct event *thread)
  {
        struct listnode *node, *nnode;
        struct isis_dynhn *dyn;
        time_t now = time(NULL);
        struct isis *isis = NULL;
  
 -      isis = THREAD_ARG(thread);
 +      isis = EVENT_ARG(thread);
  
        isis->t_dync_clean = NULL;
  
@@@ -72,7 -72,7 +72,7 @@@
                XFREE(MTYPE_ISIS_DYNHN, dyn);
        }
  
 -      thread_add_timer(master, dyn_cache_cleanup, isis, 120,
 +      event_add_timer(master, dyn_cache_cleanup, isis, 120,
                        &isis->t_dync_clean);
  }
  
@@@ -145,12 -145,10 +145,10 @@@ void dynhn_print_all(struct vty *vty, s
        vty_out(vty, "Level  System ID      Dynamic Hostname\n");
        for (ALL_LIST_ELEMENTS_RO(isis->dyn_cache, node, dyn)) {
                vty_out(vty, "%-7d", dyn->level);
-               vty_out(vty, "%-15s%-15s\n", sysid_print(dyn->id),
-                       dyn->hostname);
+               vty_out(vty, "%pSY %-15s\n", dyn->id, dyn->hostname);
        }
  
-       vty_out(vty, "     * %s %s\n", sysid_print(isis->sysid),
-               cmd_hostname_get());
+       vty_out(vty, "     * %pSY %s\n", isis->sysid, cmd_hostname_get());
        return;
  }
  
diff --combined isisd/isis_events.c
index 8a2a2ab971edd084dd1bf4f36f03d67a478bb727,982fa97df8e7205164bf0518060c70859b8fd1ac..32231a079f1af104800e085d00a65d180eb2e74a
@@@ -13,7 -13,7 +13,7 @@@
  #include "if.h"
  #include "linklist.h"
  #include "command.h"
 -#include "thread.h"
 +#include "frrevent.h"
  #include "hash.h"
  #include "prefix.h"
  #include "stream.h"
@@@ -63,23 -63,23 +63,23 @@@ static void circuit_commence_level(stru
  
        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]);
 +                      event_add_timer(master, send_l1_psnp, circuit,
 +                                      isis_jitter(circuit->psnp_interval[0],
 +                                                  PSNP_JITTER),
 +                                      &circuit->t_send_psnp[0]);
                } else {
 -                      thread_add_timer(master, send_l2_psnp, circuit,
 -                                       isis_jitter(circuit->psnp_interval[1],
 -                                                   PSNP_JITTER),
 -                                       &circuit->t_send_psnp[1]);
 +                      event_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,
 -                               &circuit->level_arg[level - 1],
 -                               2 * circuit->hello_interval[level - 1],
 -                               &circuit->u.bc.t_run_dr[level - 1]);
 +              event_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();
@@@ -96,13 -96,13 +96,13 @@@ static void circuit_resign_level(struc
                        circuit->area->area_tag, circuit->circuit_id,
                        circuit->interface->name, level);
  
 -      THREAD_OFF(circuit->t_send_csnp[idx]);
 -      THREAD_OFF(circuit->t_send_psnp[idx]);
 +      EVENT_OFF(circuit->t_send_csnp[idx]);
 +      EVENT_OFF(circuit->t_send_psnp[idx]);
  
        if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
 -              THREAD_OFF(circuit->u.bc.t_send_lan_hello[idx]);
 -              THREAD_OFF(circuit->u.bc.t_run_dr[idx]);
 -              THREAD_OFF(circuit->u.bc.t_refresh_pseudo_lsp[idx]);
 +              EVENT_OFF(circuit->u.bc.t_send_lan_hello[idx]);
 +              EVENT_OFF(circuit->u.bc.t_run_dr[idx]);
 +              EVENT_OFF(circuit->u.bc.t_refresh_pseudo_lsp[idx]);
                circuit->lsp_regenerate_pending[idx] = 0;
                circuit->u.bc.run_dr_elect[idx] = 0;
                circuit->u.bc.is_dr[idx] = 0;
@@@ -196,11 -196,11 +196,11 @@@ void isis_circuit_is_type_set(struct is
  
  /* events supporting code */
  
 -void isis_event_dis_status_change(struct thread *thread)
 +void isis_event_dis_status_change(struct event *thread)
  {
        struct isis_circuit *circuit;
  
 -      circuit = THREAD_ARG(thread);
 +      circuit = EVENT_ARG(thread);
  
        /* invalid arguments */
        if (!circuit || !circuit->area)
@@@ -217,8 -217,8 +217,8 @@@ void isis_event_auth_failure(char *area
                             uint8_t *sysid)
  {
        if (IS_DEBUG_EVENTS)
-               zlog_debug("ISIS-Evt (%s) Authentication failure %s from %s",
-                          area_tag, error_string, sysid_print(sysid));
+               zlog_debug("ISIS-Evt (%s) Authentication failure %s from %pSY",
+                          area_tag, error_string, sysid);
  
        return;
  }
diff --combined isisd/isis_lfa.c
index 7a25a9253553385e304d10a1a92580b8b99382a5,febebe8dc5af5c5de98c154ff975cc86b58a30c9..abb6168393cd9e6c3e3ee616fce4ea17e50e3b36
@@@ -1388,9 -1388,9 +1388,9 @@@ static struct rlfa *rlfa_lookup(struct 
        return rlfa_tree_find(&spftree->lfa.remote.rlfas, &s);
  }
  
 -static void isis_area_verify_routes_cb(struct thread *thread)
 +static void isis_area_verify_routes_cb(struct event *thread)
  {
 -      struct isis_area *area = THREAD_ARG(thread);
 +      struct isis_area *area = EVENT_ARG(thread);
  
        if (IS_DEBUG_LFA)
                zlog_debug("ISIS-LFA: updating RLFAs in the RIB");
@@@ -1466,8 -1466,8 +1466,8 @@@ int isis_rlfa_activate(struct isis_spft
                if (ldp_label == MPLS_INVALID_LABEL) {
                        if (IS_DEBUG_LFA)
                                zlog_debug(
-                                       "ISIS-LFA: failed to activate RLFA: missing LDP label to reach PQ node through %s",
-                                       sysid_print(vadj->sadj->id));
+                                       "ISIS-LFA: failed to activate RLFA: missing LDP label to reach PQ node through %pSY",
+                                       vadj->sadj->id);
                        return -1;
                }
  
                          spftree->route_table_backup);
        spftree->lfa.protection_counters.rlfa[vertex->N.ip.priority] += 1;
  
 -      THREAD_OFF(area->t_rlfa_rib_update);
 -      thread_add_timer(master, isis_area_verify_routes_cb, area, 2,
 -                       &area->t_rlfa_rib_update);
 +      EVENT_OFF(area->t_rlfa_rib_update);
 +      event_add_timer(master, isis_area_verify_routes_cb, area, 2,
 +                      &area->t_rlfa_rib_update);
  
        return 0;
  }
@@@ -1525,9 -1525,9 +1525,9 @@@ void isis_rlfa_deactivate(struct isis_s
        isis_route_delete(area, rn, spftree->route_table_backup);
        spftree->lfa.protection_counters.rlfa[vertex->N.ip.priority] -= 1;
  
 -      THREAD_OFF(area->t_rlfa_rib_update);
 -      thread_add_timer(master, isis_area_verify_routes_cb, area, 2,
 -                       &area->t_rlfa_rib_update);
 +      EVENT_OFF(area->t_rlfa_rib_update);
 +      event_add_timer(master, isis_area_verify_routes_cb, area, 2,
 +                      &area->t_rlfa_rib_update);
  }
  
  void isis_rlfa_list_init(struct isis_spftree *spftree)
diff --combined isisd/isis_lsp.c
index d569f6bd5be66e67685b5d5bcb03ee4954884863,dbe798e05d17e84ea217ef4fd10cfecae7e7dab8..fb69448d042c966635803c01c7bbe23a2be2a4ad
@@@ -12,7 -12,7 +12,7 @@@
  #include <zebra.h>
  
  #include "linklist.h"
 -#include "thread.h"
 +#include "frrevent.h"
  #include "vty.h"
  #include "stream.h"
  #include "memory.h"
@@@ -49,9 -49,9 +49,9 @@@
  
  DEFINE_MTYPE_STATIC(ISISD, ISIS_LSP, "ISIS LSP");
  
 -static void lsp_refresh(struct thread *thread);
 -static void lsp_l1_refresh_pseudo(struct thread *thread);
 -static void lsp_l2_refresh_pseudo(struct thread *thread);
 +static void lsp_refresh(struct event *thread);
 +static void lsp_l1_refresh_pseudo(struct event *thread);
 +static void lsp_l2_refresh_pseudo(struct event *thread);
  
  static void lsp_destroy(struct isis_lsp *lsp);
  
@@@ -193,10 -193,9 +193,9 @@@ int lsp_compare(char *areatag, struct i
                || (lsp->hdr.rem_lifetime != 0 && rem_lifetime != 0))) {
                if (IS_DEBUG_SNP_PACKETS) {
                        zlog_debug(
-                               "ISIS-Snp (%s): Compare LSP %s seq 0x%08x, cksum 0x%04hx, lifetime %hus",
-                               areatag, rawlspid_print(lsp->hdr.lsp_id),
-                               lsp->hdr.seqno, lsp->hdr.checksum,
-                               lsp->hdr.rem_lifetime);
+                               "ISIS-Snp (%s): Compare LSP %pLS seq 0x%08x, cksum 0x%04hx, lifetime %hus",
+                               areatag, lsp->hdr.lsp_id, lsp->hdr.seqno,
+                               lsp->hdr.checksum, lsp->hdr.rem_lifetime);
                        zlog_debug(
                                "ISIS-Snp (%s):         is equal to ours seq 0x%08x, cksum 0x%04hx, lifetime %hus",
                                areatag, seqno, checksum, rem_lifetime);
                        && lsp->hdr.rem_lifetime)))) {
                if (IS_DEBUG_SNP_PACKETS) {
                        zlog_debug(
-                               "ISIS-Snp (%s): Compare LSP %s seq 0x%08x, cksum 0x%04hx, lifetime %hus",
-                               areatag, rawlspid_print(lsp->hdr.lsp_id), seqno,
-                               checksum, rem_lifetime);
+                               "ISIS-Snp (%s): Compare LSP %pLS seq 0x%08x, cksum 0x%04hx, lifetime %hus",
+                               areatag, lsp->hdr.lsp_id, seqno, checksum,
+                               rem_lifetime);
                        zlog_debug(
                                "ISIS-Snp (%s):       is newer than ours seq 0x%08x, cksum 0x%04hx, lifetime %hus",
                                areatag, lsp->hdr.seqno, lsp->hdr.checksum,
                return LSP_NEWER;
        }
        if (IS_DEBUG_SNP_PACKETS) {
-               zlog_debug("ISIS-Snp (%s): Compare LSP %s seq 0x%08x, cksum 0x%04hx, lifetime %hus",
-                          areatag, rawlspid_print(lsp->hdr.lsp_id), seqno,
-                          checksum, rem_lifetime);
+               zlog_debug(
+                       "ISIS-Snp (%s): Compare LSP %pLS seq 0x%08x, cksum 0x%04hx, lifetime %hus",
+                       areatag, lsp->hdr.lsp_id, seqno, checksum,
+                       rem_lifetime);
                zlog_debug(
                        "ISIS-Snp (%s):       is older than ours seq 0x%08x, cksum 0x%04hx, lifetime %hus",
                        areatag, lsp->hdr.seqno, lsp->hdr.checksum,
@@@ -429,9 -429,9 +429,9 @@@ bool isis_level2_adj_up(struct isis_are
  /*
   * Unset the overload bit after the timer expires
   */
 -void set_overload_on_start_timer(struct thread *thread)
 +void set_overload_on_start_timer(struct event *thread)
  {
 -      struct isis_area *area = THREAD_ARG(thread);
 +      struct isis_area *area = EVENT_ARG(thread);
        assert(area);
  
        area->t_overload_on_startup_timer = NULL;
@@@ -554,8 -554,8 +554,8 @@@ void lsp_update(struct isis_lsp *lsp, s
        if (lsp->own_lsp) {
                flog_err(
                        EC_LIB_DEVELOPMENT,
-                       "ISIS-Upd (%s): BUG updating LSP %s still marked as own LSP",
-                       area->area_tag, rawlspid_print(lsp->hdr.lsp_id));
+                       "ISIS-Upd (%s): BUG updating LSP %pLS still marked as own LSP",
+                       area->area_tag, lsp->hdr.lsp_id);
                lsp_clear_data(lsp);
                lsp->own_lsp = 0;
        }
@@@ -634,10 -634,8 +634,8 @@@ struct isis_lsp *lsp_new(struct isis_ar
        put_lsp_hdr(lsp, NULL, false);
  
        if (IS_DEBUG_EVENTS)
-               zlog_debug("New LSP with ID %s-%02x-%02x len %d seqnum %08x",
-                          sysid_print(lsp_id), LSP_PSEUDO_ID(lsp->hdr.lsp_id),
-                          LSP_FRAGMENT(lsp->hdr.lsp_id), lsp->hdr.pdu_len,
-                          lsp->hdr.seqno);
+               zlog_debug("New LSP with ID %pLS len %d seqnum %08x", lsp_id,
+                          lsp->hdr.pdu_len, lsp->hdr.seqno);
  
        return lsp;
  }
@@@ -704,7 -702,7 +702,7 @@@ void lspid_print(uint8_t *lsp_id, char 
        else if (!memcmp(isis->sysid, lsp_id, ISIS_SYS_ID_LEN) && dynhost)
                snprintf(id, sizeof(id), "%.14s", cmd_hostname_get());
        else
-               memcpy(id, sysid_print(lsp_id), 15);
+               snprintf(id, sizeof(id), "%pSY", lsp_id);
  
        if (frag)
                snprintf(dest, dest_len, "%s.%02x-%02x", id,
@@@ -1250,10 -1248,8 +1248,8 @@@ static void lsp_build(struct isis_lsp *
                                if (LSP_PSEUDO_ID(ne_id)) {
                                        if (area->oldmetric) {
                                                lsp_debug(
-                                                       "ISIS (%s): Adding DIS %s.%02x as old-style neighbor",
-                                                       area->area_tag,
-                                                       sysid_print(ne_id),
-                                                       LSP_PSEUDO_ID(ne_id));
+                                                       "ISIS (%s): Adding DIS %pPN as old-style neighbor",
+                                                       area->area_tag, ne_id);
                                                isis_tlvs_add_oldstyle_reach(
                                                        lsp->tlvs, ne_id,
                                                        metric);
  
                                if (area->oldmetric) {
                                        lsp_debug(
-                                               "ISIS (%s): Adding old-style is reach for %s",
-                                               area->area_tag,
-                                               sysid_print(ne_id));
+                                               "ISIS (%s): Adding old-style is reach for %pSY",
+                                               area->area_tag, ne_id);
                                        isis_tlvs_add_oldstyle_reach(
                                                lsp->tlvs, ne_id, metric);
                                }
@@@ -1372,7 -1367,7 +1367,7 @@@ int lsp_generate(struct isis_area *area
                return ISIS_ERROR;
  
        /* Check if config is still being processed */
 -      if (thread_is_scheduled(t_isis_cfg))
 +      if (event_is_scheduled(t_isis_cfg))
                return ISIS_OK;
  
        memset(&lspid, 0, ISIS_SYS_ID_LEN + 2);
                overload_time = isis_restart_read_overload_time(area);
                if (overload_time > 0) {
                        isis_area_overload_bit_set(area, true);
 -                      thread_add_timer(master, set_overload_on_start_timer,
 -                                       area, overload_time,
 -                                       &area->t_overload_on_startup_timer);
 +                      event_add_timer(master, set_overload_on_start_timer,
 +                                      area, overload_time,
 +                                      &area->t_overload_on_startup_timer);
                }
                device_startup = false;
        }
  
        refresh_time = lsp_refresh_time(newlsp, rem_lifetime);
  
 -      THREAD_OFF(area->t_lsp_refresh[level - 1]);
 +      EVENT_OFF(area->t_lsp_refresh[level - 1]);
        area->lsp_regenerate_pending[level - 1] = 0;
 -      thread_add_timer(master, lsp_refresh,
 -                       &area->lsp_refresh_arg[level - 1], refresh_time,
 -                       &area->t_lsp_refresh[level - 1]);
 +      event_add_timer(master, lsp_refresh, &area->lsp_refresh_arg[level - 1],
 +                      refresh_time, &area->t_lsp_refresh[level - 1]);
  
        if (IS_DEBUG_UPDATE_PACKETS) {
-               zlog_debug("ISIS-Upd (%s): Building L%d LSP %s, len %hu, seq 0x%08x, cksum 0x%04hx, lifetime %hus refresh %hus",
-                          area->area_tag, level,
-                          rawlspid_print(newlsp->hdr.lsp_id),
-                          newlsp->hdr.pdu_len, newlsp->hdr.seqno,
-                          newlsp->hdr.checksum, newlsp->hdr.rem_lifetime,
-                          refresh_time);
+               zlog_debug(
+                       "ISIS-Upd (%s): Building L%d LSP %pLS, len %hu, seq 0x%08x, cksum 0x%04hx, lifetime %hus refresh %hus",
+                       area->area_tag, level, newlsp->hdr.lsp_id,
+                       newlsp->hdr.pdu_len, newlsp->hdr.seqno,
+                       newlsp->hdr.checksum, newlsp->hdr.rem_lifetime,
+                       refresh_time);
        }
        sched_debug(
                "ISIS (%s): Built L%d LSP. Set triggered regenerate to non-pending.",
@@@ -1500,14 -1496,15 +1495,14 @@@ static int lsp_regenerate(struct isis_a
        lsp_seqno_update(lsp);
  
        refresh_time = lsp_refresh_time(lsp, rem_lifetime);
 -      thread_add_timer(master, lsp_refresh,
 -                       &area->lsp_refresh_arg[level - 1], refresh_time,
 -                       &area->t_lsp_refresh[level - 1]);
 +      event_add_timer(master, lsp_refresh, &area->lsp_refresh_arg[level - 1],
 +                      refresh_time, &area->t_lsp_refresh[level - 1]);
        area->lsp_regenerate_pending[level - 1] = 0;
  
        if (IS_DEBUG_UPDATE_PACKETS) {
                zlog_debug(
-                       "ISIS-Upd (%s): Refreshed our L%d LSP %s, len %hu, seq 0x%08x, cksum 0x%04hx, lifetime %hus refresh %hus",
-                       area->area_tag, level, rawlspid_print(lsp->hdr.lsp_id),
+                       "ISIS-Upd (%s): Refreshed our L%d LSP %pLS, len %hu, seq 0x%08x, cksum 0x%04hx, lifetime %hus refresh %hus",
+                       area->area_tag, level, lsp->hdr.lsp_id,
                        lsp->hdr.pdu_len, lsp->hdr.seqno, lsp->hdr.checksum,
                        lsp->hdr.rem_lifetime, refresh_time);
        }
  /*
   * Something has changed or periodic refresh -> regenerate LSP
   */
 -static void lsp_refresh(struct thread *thread)
 +static void lsp_refresh(struct event *thread)
  {
 -      struct lsp_refresh_arg *arg = THREAD_ARG(thread);
 +      struct lsp_refresh_arg *arg = EVENT_ARG(thread);
  
        assert(arg);
  
@@@ -1603,7 -1600,7 +1598,7 @@@ int _lsp_regenerate_schedule(struct isi
                         * 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)",
                        "ISIS (%s): Will schedule regen timer. Last run was: %lld, Now is: %lld",
                        area->area_tag, (long long)lsp->last_generated,
                        (long long)now);
 -              THREAD_OFF(area->t_lsp_refresh[lvl - 1]);
 +              EVENT_OFF(area->t_lsp_refresh[lvl - 1]);
                diff = now - lsp->last_generated;
                if (diff < area->lsp_gen_interval[lvl - 1]
                    && !(area->bfd_signalled_down)) {
                }
  
                area->lsp_regenerate_pending[lvl - 1] = 1;
 -              thread_add_timer_msec(master, lsp_refresh,
 -                                    &area->lsp_refresh_arg[lvl - 1],
 -                                    timeout,
 -                                    &area->t_lsp_refresh[lvl - 1]);
 +              event_add_timer_msec(master, lsp_refresh,
 +                                   &area->lsp_refresh_arg[lvl - 1], timeout,
 +                                   &area->t_lsp_refresh[lvl - 1]);
        }
  
        if (all_pseudo) {
@@@ -1698,9 -1696,9 +1693,9 @@@ static void lsp_build_pseudo(struct isi
        lsp_clear_data(lsp);
        lsp->tlvs = isis_alloc_tlvs();
        lsp_debug(
-               "ISIS (%s): Constructing pseudo LSP %s for interface %s level %d",
-               area->area_tag, rawlspid_print(lsp->hdr.lsp_id),
-               circuit->interface->name, level);
+               "ISIS (%s): Constructing pseudo LSP %pLS for interface %s level %d",
+               area->area_tag, lsp->hdr.lsp_id, circuit->interface->name,
+               level);
  
        lsp->level = level;
        /* RFC3787  section 4 SHOULD not set overload bit in pseudo LSPs */
  
        if (circuit->area->oldmetric) {
                isis_tlvs_add_oldstyle_reach(lsp->tlvs, ne_id, 0);
-               lsp_debug(
-                       "ISIS (%s): Adding %s.%02x as old-style neighbor (self)",
-                       area->area_tag, sysid_print(ne_id),
-                       LSP_PSEUDO_ID(ne_id));
+               lsp_debug("ISIS (%s): Adding %pPN as old-style neighbor (self)",
+                         area->area_tag, ne_id);
        }
        if (circuit->area->newmetric) {
                if (area_is_mt(circuit->area))
                else
                        mtid = ISIS_MT_DISABLE;
                isis_tlvs_add_extended_reach(lsp->tlvs, mtid, ne_id, 0, NULL);
-               lsp_debug(
-                       "ISIS (%s): Adding %s.%02x as te-style neighbor (self)",
-                       area->area_tag, sysid_print(ne_id),
-                       LSP_PSEUDO_ID(ne_id));
+               lsp_debug("ISIS (%s): Adding %pPN as te-style neighbor (self)",
+                         area->area_tag, ne_id);
        }
  
        adj_list = list_new();
        for (ALL_LIST_ELEMENTS_RO(adj_list, node, adj)) {
                if (!(adj->level & level)) {
                        lsp_debug(
-                               "ISIS (%s): Ignoring neighbor %s, level does not intersect",
-                               area->area_tag, sysid_print(adj->sysid));
+                               "ISIS (%s): Ignoring neighbor %pSY, level does not intersect",
+                               area->area_tag, adj->sysid);
                        continue;
                }
  
                    && !(level == IS_LEVEL_2
                         && adj->sys_type == ISIS_SYSTYPE_L2_IS)) {
                        lsp_debug(
-                               "ISIS (%s): Ignoring neighbor %s, level does not match",
-                               area->area_tag, sysid_print(adj->sysid));
+                               "ISIS (%s): Ignoring neighbor %pSY, level does not match",
+                               area->area_tag, adj->sysid);
                        continue;
                }
  
                if (circuit->area->oldmetric) {
                        isis_tlvs_add_oldstyle_reach(lsp->tlvs, ne_id, 0);
                        lsp_debug(
-                               "ISIS (%s): Adding %s.%02x as old-style neighbor (peer)",
-                               area->area_tag, sysid_print(ne_id),
-                               LSP_PSEUDO_ID(ne_id));
+                               "ISIS (%s): Adding %pPN as old-style neighbor (peer)",
+                               area->area_tag, ne_id);
                }
                if (circuit->area->newmetric) {
                        isis_tlvs_add_extended_reach(lsp->tlvs,
                                                     ISIS_MT_IPV4_UNICAST,
                                                     ne_id, 0, NULL);
                        lsp_debug(
-                               "ISIS (%s): Adding %s.%02x as te-style neighbor (peer)",
-                               area->area_tag, sysid_print(ne_id),
-                               LSP_PSEUDO_ID(ne_id));
+                               "ISIS (%s): Adding %pPN as te-style neighbor (peer)",
+                               area->area_tag, ne_id);
                }
        }
        list_delete(&adj_list);
@@@ -1819,23 -1811,22 +1808,22 @@@ int lsp_generate_pseudo(struct isis_cir
        lsp_flood(lsp, NULL);
  
        refresh_time = lsp_refresh_time(lsp, rem_lifetime);
 -      THREAD_OFF(circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
 +      EVENT_OFF(circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
        circuit->lsp_regenerate_pending[level - 1] = 0;
        if (level == IS_LEVEL_1)
 -              thread_add_timer(
 -                      master, lsp_l1_refresh_pseudo, circuit, refresh_time,
 -                      &circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
 +              event_add_timer(master, lsp_l1_refresh_pseudo, circuit,
 +                              refresh_time,
 +                              &circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
        else if (level == IS_LEVEL_2)
 -              thread_add_timer(
 -                      master, lsp_l2_refresh_pseudo, circuit, refresh_time,
 -                      &circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
 +              event_add_timer(master, lsp_l2_refresh_pseudo, circuit,
 +                              refresh_time,
 +                              &circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
  
        if (IS_DEBUG_UPDATE_PACKETS) {
                zlog_debug(
-                       "ISIS-Upd (%s): Built L%d Pseudo LSP %s, len %hu, seq 0x%08x, cksum 0x%04hx, lifetime %hus, refresh %hus",
-                       circuit->area->area_tag, level,
-                       rawlspid_print(lsp->hdr.lsp_id), lsp->hdr.pdu_len,
-                       lsp->hdr.seqno, lsp->hdr.checksum,
+                       "ISIS-Upd (%s): Built L%d Pseudo LSP %pLS, len %hu, seq 0x%08x, cksum 0x%04hx, lifetime %hus, refresh %hus",
+                       circuit->area->area_tag, level, lsp->hdr.lsp_id,
+                       lsp->hdr.pdu_len, lsp->hdr.seqno, lsp->hdr.checksum,
                        lsp->hdr.rem_lifetime, refresh_time);
        }
  
@@@ -1863,8 -1854,8 +1851,8 @@@ static int lsp_regenerate_pseudo(struc
  
        if (!lsp) {
                flog_err(EC_LIB_DEVELOPMENT,
-                        "lsp_regenerate_pseudo: no l%d LSP %s found!", level,
-                        rawlspid_print(lsp_id));
+                        "lsp_regenerate_pseudo: no l%d LSP %pLS found!", level,
+                        lsp_id);
                return ISIS_ERROR;
        }
  
  
        refresh_time = lsp_refresh_time(lsp, rem_lifetime);
        if (level == IS_LEVEL_1)
 -              thread_add_timer(
 -                      master, lsp_l1_refresh_pseudo, circuit, refresh_time,
 -                      &circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
 +              event_add_timer(master, lsp_l1_refresh_pseudo, circuit,
 +                              refresh_time,
 +                              &circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
        else if (level == IS_LEVEL_2)
 -              thread_add_timer(
 -                      master, lsp_l2_refresh_pseudo, circuit, refresh_time,
 -                      &circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
 +              event_add_timer(master, lsp_l2_refresh_pseudo, circuit,
 +                              refresh_time,
 +                              &circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
  
        if (IS_DEBUG_UPDATE_PACKETS) {
                zlog_debug(
-                       "ISIS-Upd (%s): Refreshed L%d Pseudo LSP %s, len %hu, seq 0x%08x, cksum 0x%04hx, lifetime %hus, refresh %hus",
-                       circuit->area->area_tag, level,
-                       rawlspid_print(lsp->hdr.lsp_id), lsp->hdr.pdu_len,
-                       lsp->hdr.seqno, lsp->hdr.checksum,
+                       "ISIS-Upd (%s): Refreshed L%d Pseudo LSP %pLS, len %hu, seq 0x%08x, cksum 0x%04hx, lifetime %hus, refresh %hus",
+                       circuit->area->area_tag, level, lsp->hdr.lsp_id,
+                       lsp->hdr.pdu_len, lsp->hdr.seqno, lsp->hdr.checksum,
                        lsp->hdr.rem_lifetime, refresh_time);
        }
  
  /*
   * Something has changed or periodic refresh -> regenerate pseudo LSP
   */
 -static void lsp_l1_refresh_pseudo(struct thread *thread)
 +static void lsp_l1_refresh_pseudo(struct event *thread)
  {
        struct isis_circuit *circuit;
        uint8_t id[ISIS_SYS_ID_LEN + 2];
  
 -      circuit = THREAD_ARG(thread);
 +      circuit = EVENT_ARG(thread);
  
        circuit->u.bc.t_refresh_pseudo_lsp[0] = NULL;
        circuit->lsp_regenerate_pending[0] = 0;
        lsp_regenerate_pseudo(circuit, IS_LEVEL_1);
  }
  
 -static void lsp_l2_refresh_pseudo(struct thread *thread)
 +static void lsp_l2_refresh_pseudo(struct event *thread)
  {
        struct isis_circuit *circuit;
        uint8_t id[ISIS_SYS_ID_LEN + 2];
  
 -      circuit = THREAD_ARG(thread);
 +      circuit = EVENT_ARG(thread);
  
        circuit->u.bc.t_refresh_pseudo_lsp[1] = NULL;
        circuit->lsp_regenerate_pending[1] = 0;
@@@ -1986,7 -1976,7 +1973,7 @@@ int lsp_regenerate_schedule_pseudo(stru
                }
  
                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)",
                        "ISIS (%s): Will schedule PSN regen timer. Last run was: %lld, Now is: %lld",
                        area->area_tag, (long long)lsp->last_generated,
                        (long long)now);
 -              THREAD_OFF(circuit->u.bc.t_refresh_pseudo_lsp[lvl - 1]);
 +              EVENT_OFF(circuit->u.bc.t_refresh_pseudo_lsp[lvl - 1]);
                diff = now - lsp->last_generated;
                if (diff < circuit->area->lsp_gen_interval[lvl - 1]) {
                        timeout =
                circuit->lsp_regenerate_pending[lvl - 1] = 1;
  
                if (lvl == IS_LEVEL_1) {
 -                      thread_add_timer_msec(
 +                      event_add_timer_msec(
                                master, lsp_l1_refresh_pseudo, circuit, timeout,
                                &circuit->u.bc.t_refresh_pseudo_lsp[lvl - 1]);
                } else if (lvl == IS_LEVEL_2) {
 -                      thread_add_timer_msec(
 +                      event_add_timer_msec(
                                master, lsp_l2_refresh_pseudo, circuit, timeout,
                                &circuit->u.bc.t_refresh_pseudo_lsp[lvl - 1]);
                }
   * Walk through LSPs for an area
   *  - set remaining lifetime
   */
 -void lsp_tick(struct thread *thread)
 +void lsp_tick(struct event *thread)
  {
        struct isis_area *area;
        struct isis_lsp *lsp;
        uint16_t rem_lifetime;
        bool fabricd_sync_incomplete = false;
  
 -      area = THREAD_ARG(thread);
 +      area = EVENT_ARG(thread);
        assert(area);
        area->t_tick = NULL;
 -      thread_add_timer(master, lsp_tick, area, 1, &area->t_tick);
 +      event_add_timer(master, lsp_tick, area, 1, &area->t_tick);
  
        struct isis_circuit *fabricd_init_c = fabricd_initial_sync_circuit(area);
  
  
                        if (lsp->age_out == 0) {
                                zlog_debug(
-                                       "ISIS-Upd (%s): L%u LSP %s seq 0x%08x aged out",
+                                       "ISIS-Upd (%s): L%u LSP %pLS seq 0x%08x aged out",
                                        area->area_tag, lsp->level,
-                                       rawlspid_print(lsp->hdr.lsp_id),
-                                       lsp->hdr.seqno);
+                                       lsp->hdr.lsp_id, lsp->hdr.seqno);
  
                                /* if we're aging out fragment 0, lsp_destroy()
                                 * below will delete all other fragments too,
@@@ -2207,11 -2196,10 +2193,10 @@@ void _lsp_flood(struct isis_lsp *lsp, s
                const char *func, const char *file, int line)
  {
        if (IS_DEBUG_FLOODING) {
-               zlog_debug("Flooding LSP %s%s%s (From %s %s:%d)",
-                          rawlspid_print(lsp->hdr.lsp_id),
-                          circuit ? " except on " : "",
-                          circuit ? circuit->interface->name : "",
-                          func, file, line);
+               zlog_debug("Flooding LSP %pLS%s%s (From %s %s:%d)",
+                          lsp->hdr.lsp_id, circuit ? " except on " : "",
+                          circuit ? circuit->interface->name : "", func, file,
+                          line);
        }
  
        if (!fabricd)
diff --combined isisd/isis_pdu.c
index d53d43ad0ecb5cca964750097bd03acb55f2ac78,9e5a6d23ae1ceded184f7e7780b48ea85d6baabc..0b84289f2d567962316295c57cde3a11a75ccc80
@@@ -11,7 -11,7 +11,7 @@@
  #include <zebra.h>
  
  #include "memory.h"
 -#include "thread.h"
 +#include "frrevent.h"
  #include "linklist.h"
  #include "log.h"
  #include "stream.h"
@@@ -192,9 -192,9 +192,9 @@@ static int process_p2p_hello(struct iih
                                      adj);
  
        /* lets take care of the expiry */
 -      THREAD_OFF(adj->t_expire);
 -      thread_add_timer(master, isis_adj_expire, adj, (long)adj->hold_time,
 -                       &adj->t_expire);
 +      EVENT_OFF(adj->t_expire);
 +      event_add_timer(master, isis_adj_expire, adj, (long)adj->hold_time,
 +                      &adj->t_expire);
  
        /* While fabricds initial sync is in progress, ignore hellos from other
         * interfaces than the one we are performing the initial sync on. */
@@@ -466,8 -466,8 +466,8 @@@ static int process_lan_hello(struct iih
                                       : iih->circuit->u.bc.l2_desig_is;
  
                if (memcmp(dis, iih->dis, ISIS_SYS_ID_LEN + 1)) {
 -                      thread_add_event(master, isis_event_dis_status_change,
 -                                       iih->circuit, 0, NULL);
 +                      event_add_event(master, isis_event_dis_status_change,
 +                                      iih->circuit, 0, NULL);
                        memcpy(dis, iih->dis, ISIS_SYS_ID_LEN + 1);
                }
        }
                                      adj);
  
        /* lets take care of the expiry */
 -      THREAD_OFF(adj->t_expire);
 -      thread_add_timer(master, isis_adj_expire, adj, (long)adj->hold_time,
 -                       &adj->t_expire);
 +      EVENT_OFF(adj->t_expire);
 +      event_add_timer(master, isis_adj_expire, adj, (long)adj->hold_time,
 +                      &adj->t_expire);
  
        /*
         * If the snpa for this circuit is found from LAN Neighbours TLV
  
        if (IS_DEBUG_ADJ_PACKETS) {
                zlog_debug(
-                       "ISIS-Adj (%s): Rcvd L%d LAN IIH from %s on %s, cirType %s, cirID %u, length %zd",
-                       iih->circuit->area->area_tag, iih->level,
-                       snpa_print(iih->ssnpa), iih->circuit->interface->name,
+                       "ISIS-Adj (%s): Rcvd L%d LAN IIH from %pSY on %s, cirType %s, cirID %u, length %zd",
+                       iih->circuit->area->area_tag, iih->level, iih->ssnpa,
+                       iih->circuit->interface->name,
                        circuit_t2string(iih->circuit->is_type),
                        iih->circuit->circuit_id,
                        stream_get_endp(iih->circuit->rcv_stream));
@@@ -862,31 -862,32 +862,32 @@@ static int process_lsp(uint8_t pdu_type
  
  #ifndef FABRICD
        /* send northbound notification */
+       char buf[ISO_SYSID_STRLEN];
+       snprintfrr(buf, ISO_SYSID_STRLEN, "%pSY", hdr.lsp_id);
        isis_notif_lsp_received(circuit, hdr.lsp_id, hdr.seqno, time(NULL),
-                               sysid_print(hdr.lsp_id));
+                               buf);
  #endif /* ifndef FABRICD */
  
        if (pdu_len_validate(hdr.pdu_len, circuit)) {
-               zlog_debug("ISIS-Upd (%s): LSP %s invalid LSP length %hu",
-                          circuit->area->area_tag, rawlspid_print(hdr.lsp_id),
-                          hdr.pdu_len);
+               zlog_debug("ISIS-Upd (%s): LSP %pLS invalid LSP length %hu",
+                          circuit->area->area_tag, hdr.lsp_id, hdr.pdu_len);
                return ISIS_WARNING;
        }
  
        if (IS_DEBUG_UPDATE_PACKETS) {
-               zlog_debug("ISIS-Upd (%s): Rcvd L%d LSP %s, seq 0x%08x, cksum 0x%04hx, lifetime %hus, len %hu, on %s",
-                          circuit->area->area_tag, level,
-                          rawlspid_print(hdr.lsp_id), hdr.seqno, hdr.checksum,
-                          hdr.rem_lifetime, hdr.pdu_len,
-                          circuit->interface->name);
+               zlog_debug(
+                       "ISIS-Upd (%s): Rcvd L%d LSP %pLS, seq 0x%08x, cksum 0x%04hx, lifetime %hus, len %hu, on %s",
+                       circuit->area->area_tag, level, hdr.lsp_id, hdr.seqno,
+                       hdr.checksum, hdr.rem_lifetime, hdr.pdu_len,
+                       circuit->interface->name);
        }
  
        /* lsp is_type check */
        if ((hdr.lsp_bits & IS_LEVEL_1) != IS_LEVEL_1) {
-               zlog_debug(
-                       "ISIS-Upd (%s): LSP %s invalid LSP is type 0x%x",
-                       circuit->area->area_tag, rawlspid_print(hdr.lsp_id),
-                       hdr.lsp_bits & IS_LEVEL_1_AND_2);
+               zlog_debug("ISIS-Upd (%s): LSP %pLS invalid LSP is type 0x%x",
+                          circuit->area->area_tag, hdr.lsp_id,
+                          hdr.lsp_bits & IS_LEVEL_1_AND_2);
                /* continue as per RFC1122 Be liberal in what you accept, and
                 * conservative in what you send */
        }
        if (iso_csum_verify(STREAM_DATA(circuit->rcv_stream) + 12,
                            hdr.pdu_len - 12, hdr.checksum, 12)) {
                zlog_debug(
-                       "ISIS-Upd (%s): LSP %s invalid LSP checksum 0x%04hx",
-                       circuit->area->area_tag, rawlspid_print(hdr.lsp_id),
-                       hdr.checksum);
+                       "ISIS-Upd (%s): LSP %pLS invalid LSP checksum 0x%04hx",
+                       circuit->area->area_tag, hdr.lsp_id, hdr.checksum);
                return ISIS_WARNING;
        }
  
        /* 7.3.15.1 a) 1 - external domain circuit will discard lsps */
        if (circuit->ext_domain) {
                zlog_debug(
-                       "ISIS-Upd (%s): LSP %s received at level %d over circuit with externalDomain = true",
-                       circuit->area->area_tag, rawlspid_print(hdr.lsp_id),
-                       level);
+                       "ISIS-Upd (%s): LSP %pLS received at level %d over circuit with externalDomain = true",
+                       circuit->area->area_tag, hdr.lsp_id, level);
                return ISIS_WARNING;
        }
  
        /* 7.3.15.1 a) 2,3 - manualL2OnlyMode not implemented */
        if (!(circuit->is_type & level)) {
                zlog_debug(
-                       "ISIS-Upd (%s): LSP %s received at level %d over circuit of type %s",
-                       circuit->area->area_tag, rawlspid_print(hdr.lsp_id),
-                       level, circuit_t2string(circuit->is_type));
+                       "ISIS-Upd (%s): LSP %pLS received at level %d over circuit of type %s",
+                       circuit->area->area_tag, hdr.lsp_id, level,
+                       circuit_t2string(circuit->is_type));
                return ISIS_WARNING;
        }
  
        if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
                if (!isis_adj_lookup_snpa(ssnpa,
                                          circuit->u.bc.adjdb[level - 1])) {
-                       zlog_debug("(%s): DS ======= LSP %s, seq 0x%08x, cksum 0x%04hx, lifetime %hus on %s",
-                                  circuit->area->area_tag,
-                                  rawlspid_print(hdr.lsp_id), hdr.seqno,
-                                  hdr.checksum, hdr.rem_lifetime,
-                                  circuit->interface->name);
+                       zlog_debug(
+                               "(%s): DS ======= LSP %pLS, seq 0x%08x, cksum 0x%04hx, lifetime %hus on %s",
+                               circuit->area->area_tag, hdr.lsp_id, hdr.seqno,
+                               hdr.checksum, hdr.rem_lifetime,
+                               circuit->interface->name);
                        goto out; /* Silently discard */
                }
        }
@@@ -1057,9 -1056,9 +1056,9 @@@ dontcheckadj
        if (lsp && (lsp->hdr.seqno == hdr.seqno)
            && (lsp->hdr.checksum != hdr.checksum)
            && hdr.rem_lifetime) {
-               zlog_warn("ISIS-Upd (%s): LSP %s seq 0x%08x with confused checksum received.",
-                         circuit->area->area_tag, rawlspid_print(hdr.lsp_id),
-                         hdr.seqno);
+               zlog_warn(
+                       "ISIS-Upd (%s): LSP %pLS seq 0x%08x with confused checksum received.",
+                       circuit->area->area_tag, hdr.lsp_id, hdr.seqno);
                hdr.rem_lifetime = 0;
                lsp_confusion = true;
        } else
                                }
                                if (IS_DEBUG_UPDATE_PACKETS)
                                        zlog_debug(
-                                               "ISIS-Upd (%s): (1) re-originating LSP %s new seq 0x%08x",
+                                               "ISIS-Upd (%s): (1) re-originating LSP %pLS new seq 0x%08x",
                                                circuit->area->area_tag,
-                                               rawlspid_print(hdr.lsp_id),
-                                               lsp->hdr.seqno);
+                                               hdr.lsp_id, lsp->hdr.seqno);
                        } else {
                                /* our own LSP with 0 remaining life time */
  #ifndef FABRICD
  #endif /* ifndef FABRICD */
                        if (IS_DEBUG_UPDATE_PACKETS) {
                                zlog_debug(
-                                       "ISIS-Upd (%s): (2) re-originating LSP %s new seq 0x%08x",
-                                       circuit->area->area_tag,
-                                       rawlspid_print(hdr.lsp_id),
+                                       "ISIS-Upd (%s): (2) re-originating LSP %pLS new seq 0x%08x",
+                                       circuit->area->area_tag, hdr.lsp_id,
                                        lsp->hdr.seqno);
                        }
                        lsp_flood(lsp, NULL);
@@@ -1361,9 -1358,9 +1358,9 @@@ static int process_snp(uint8_t pdu_type
        if (!is_csnp && (circuit->circ_type == CIRCUIT_T_BROADCAST)
            && !circuit->u.bc.is_dr[level - 1]) {
                zlog_debug(
-                       "ISIS-Snp (%s): Rcvd L%d %cSNP from %s on %s, skipping: we are not the DIS",
-                       circuit->area->area_tag, level, typechar,
-                       snpa_print(ssnpa), circuit->interface->name);
+                       "ISIS-Snp (%s): Rcvd L%d %cSNP from %pSY on %s, skipping: we are not the DIS",
+                       circuit->area->area_tag, level, typechar, ssnpa,
+                       circuit->interface->name);
  
                return ISIS_OK;
        }
  
        /* debug isis snp-packets */
        if (IS_DEBUG_SNP_PACKETS) {
-               zlog_debug("ISIS-Snp (%s): Rcvd L%d %cSNP from %s on %s",
-                          circuit->area->area_tag, level, typechar,
-                          snpa_print(ssnpa), circuit->interface->name);
+               zlog_debug("ISIS-Snp (%s): Rcvd L%d %cSNP from %pSY on %s",
+                          circuit->area->area_tag, level, typechar, ssnpa,
+                          circuit->interface->name);
                for (struct isis_lsp_entry *entry = entry_head; entry;
                     entry = entry->next) {
                        zlog_debug(
-                               "ISIS-Snp (%s):         %cSNP entry %s, seq 0x%08x, cksum 0x%04hx, lifetime %hus",
-                               circuit->area->area_tag, typechar,
-                               rawlspid_print(entry->id), entry->seqno,
-                               entry->checksum, entry->rem_lifetime);
+                               "ISIS-Snp (%s):         %cSNP entry %pLS, seq 0x%08x, cksum 0x%04hx, lifetime %hus",
+                               circuit->area->area_tag, typechar, entry->id,
+                               entry->seqno, entry->checksum,
+                               entry->rem_lifetime);
                }
        }
  
@@@ -1654,14 -1651,12 +1651,14 @@@ int isis_handle_pdu(struct isis_circui
        if (idrp == ISO9542_ESIS) {
                flog_err(EC_LIB_DEVELOPMENT,
                         "No support for ES-IS packet IDRP=%hhx", idrp);
 +              pdu_counter_count(circuit->area->pdu_drop_counters, pdu_type);
                return ISIS_ERROR;
        }
  
        if (idrp != ISO10589_ISIS) {
                flog_err(EC_ISIS_PACKET, "Not an IS-IS packet IDRP=%hhx",
                         idrp);
 +              pdu_counter_count(circuit->area->pdu_drop_counters, pdu_type);
                return ISIS_ERROR;
        }
  
                isis_notif_version_skew(circuit, version1, raw_pdu,
                                        sizeof(raw_pdu));
  #endif /* ifndef FABRICD */
 +              pdu_counter_count(circuit->area->pdu_drop_counters, pdu_type);
                return ISIS_WARNING;
        }
  
                isis_notif_id_len_mismatch(circuit, id_len, raw_pdu,
                                           sizeof(raw_pdu));
  #endif /* ifndef FABRICD */
 +              pdu_counter_count(circuit->area->pdu_drop_counters, pdu_type);
                return ISIS_ERROR;
        }
  
        uint8_t expected_length;
        if (pdu_size(pdu_type, &expected_length)) {
                zlog_warn("Unsupported ISIS PDU %hhu", pdu_type);
 +              pdu_counter_count(circuit->area->pdu_drop_counters, pdu_type);
                return ISIS_WARNING;
        }
  
                flog_err(EC_ISIS_PACKET,
                         "Expected fixed header length = %hhu but got %hhu",
                         expected_length, length);
 +              pdu_counter_count(circuit->area->pdu_drop_counters, pdu_type);
                return ISIS_ERROR;
        }
  
                flog_err(
                        EC_ISIS_PACKET,
                        "PDU is too short to contain fixed header of given PDU type.");
 +              pdu_counter_count(circuit->area->pdu_drop_counters, pdu_type);
                return ISIS_ERROR;
        }
  
                isis_notif_version_skew(circuit, version2, raw_pdu,
                                        sizeof(raw_pdu));
  #endif /* ifndef FABRICD */
 +              pdu_counter_count(circuit->area->pdu_drop_counters, pdu_type);
                return ISIS_WARNING;
        }
  
        if (circuit->is_passive) {
                zlog_warn("Received ISIS PDU on passive circuit %s",
                          circuit->interface->name);
 +              pdu_counter_count(circuit->area->pdu_drop_counters, pdu_type);
                return ISIS_WARNING;
        }
  
                isis_notif_max_area_addr_mismatch(circuit, max_area_addrs,
                                                  raw_pdu, sizeof(raw_pdu));
  #endif /* ifndef FABRICD */
 +              pdu_counter_count(circuit->area->pdu_drop_counters, pdu_type);
                return ISIS_ERROR;
        }
  
        case L1_LAN_HELLO:
        case L2_LAN_HELLO:
        case P2P_HELLO:
 -              if (fabricd && pdu_type != P2P_HELLO)
 +              if (fabricd && pdu_type != P2P_HELLO) {
 +                      pdu_counter_count(circuit->area->pdu_drop_counters,
 +                                        pdu_type);
                        return ISIS_ERROR;
 +              }
 +
                retval = process_hello(pdu_type, circuit, ssnpa);
                break;
        case L1_LINK_STATE:
        case L2_LINK_STATE:
        case FS_LINK_STATE:
 -              if (fabricd
 -                  && pdu_type != L2_LINK_STATE
 -                  && pdu_type != FS_LINK_STATE)
 +              if (fabricd && pdu_type != L2_LINK_STATE &&
 +                  pdu_type != FS_LINK_STATE) {
 +                      pdu_counter_count(circuit->area->pdu_drop_counters,
 +                                        pdu_type);
                        return ISIS_ERROR;
 +              }
 +
                retval = process_lsp(pdu_type, circuit, ssnpa, max_area_addrs);
                break;
        case L1_COMPLETE_SEQ_NUM:
                retval = process_snp(pdu_type, circuit, ssnpa);
                break;
        default:
 +              pdu_counter_count(circuit->area->pdu_drop_counters, pdu_type);
                return ISIS_ERROR;
        }
  
 +      if (retval != ISIS_OK)
 +              pdu_counter_count(circuit->area->pdu_drop_counters, pdu_type);
 +
        return retval;
  }
  
 -void isis_receive(struct thread *thread)
 +void isis_receive(struct event *thread)
  {
        struct isis_circuit *circuit;
        uint8_t ssnpa[ETH_ALEN];
        /*
         * Get the circuit
         */
 -      circuit = THREAD_ARG(thread);
 +      circuit = EVENT_ARG(thread);
        assert(circuit);
  
        circuit->t_read = NULL;
@@@ -2030,9 -2006,9 +2027,9 @@@ int send_hello(struct isis_circuit *cir
        return retval;
  }
  
 -static void send_hello_cb(struct thread *thread)
 +static void send_hello_cb(struct event *thread)
  {
 -      struct isis_circuit_arg *arg = THREAD_ARG(thread);
 +      struct isis_circuit_arg *arg = EVENT_ARG(thread);
        assert(arg);
  
        struct isis_circuit *circuit = arg->circuit;
  }
  
  static void _send_hello_sched(struct isis_circuit *circuit,
 -                            struct thread **threadp,
 -                            int level, long delay)
 +                            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);
 +              EVENT_OFF(*threadp);
        }
  
 -      thread_add_timer_msec(master, send_hello_cb,
 -                            &circuit->level_arg[level - 1],
 -                            isis_jitter(delay, IIH_JITTER),
 -                            threadp);
 +      event_add_timer_msec(master, send_hello_cb,
 +                           &circuit->level_arg[level - 1],
 +                           isis_jitter(delay, IIH_JITTER), threadp);
  }
  
  void send_hello_sched(struct isis_circuit *circuit, int level, long delay)
@@@ -2259,11 -2237,11 +2256,11 @@@ int send_csnp(struct isis_circuit *circ
        return ISIS_OK;
  }
  
 -void send_l1_csnp(struct thread *thread)
 +void send_l1_csnp(struct event *thread)
  {
        struct isis_circuit *circuit;
  
 -      circuit = THREAD_ARG(thread);
 +      circuit = EVENT_ARG(thread);
        assert(circuit);
  
        circuit->t_send_csnp[0] = NULL;
                send_csnp(circuit, 1);
        }
        /* set next timer thread */
 -      thread_add_timer(master, send_l1_csnp, circuit,
 -                       isis_jitter(circuit->csnp_interval[0], CSNP_JITTER),
 -                       &circuit->t_send_csnp[0]);
 +      event_add_timer(master, send_l1_csnp, circuit,
 +                      isis_jitter(circuit->csnp_interval[0], CSNP_JITTER),
 +                      &circuit->t_send_csnp[0]);
  }
  
 -void send_l2_csnp(struct thread *thread)
 +void send_l2_csnp(struct event *thread)
  {
        struct isis_circuit *circuit;
  
 -      circuit = THREAD_ARG(thread);
 +      circuit = EVENT_ARG(thread);
        assert(circuit);
  
        circuit->t_send_csnp[1] = NULL;
                send_csnp(circuit, 2);
        }
        /* set next timer thread */
 -      thread_add_timer(master, send_l2_csnp, circuit,
 -                       isis_jitter(circuit->csnp_interval[1], CSNP_JITTER),
 -                       &circuit->t_send_csnp[1]);
 +      event_add_timer(master, send_l2_csnp, circuit,
 +                      isis_jitter(circuit->csnp_interval[1], CSNP_JITTER),
 +                      &circuit->t_send_csnp[1]);
  }
  
  /*
@@@ -2413,32 -2391,32 +2410,32 @@@ static int send_psnp(int level, struct 
        return ISIS_OK;
  }
  
 -void send_l1_psnp(struct thread *thread)
 +void send_l1_psnp(struct event *thread)
  {
  
        struct isis_circuit *circuit;
  
 -      circuit = THREAD_ARG(thread);
 +      circuit = EVENT_ARG(thread);
        assert(circuit);
  
        circuit->t_send_psnp[0] = NULL;
  
        send_psnp(1, circuit);
        /* set next timer thread */
 -      thread_add_timer(master, send_l1_psnp, circuit,
 -                       isis_jitter(circuit->psnp_interval[0], PSNP_JITTER),
 -                       &circuit->t_send_psnp[0]);
 +      event_add_timer(master, send_l1_psnp, circuit,
 +                      isis_jitter(circuit->psnp_interval[0], PSNP_JITTER),
 +                      &circuit->t_send_psnp[0]);
  }
  
  /*
   *  7.3.15.4 action on expiration of partial SNP interval
   *  level 2
   */
 -void send_l2_psnp(struct thread *thread)
 +void send_l2_psnp(struct event *thread)
  {
        struct isis_circuit *circuit;
  
 -      circuit = THREAD_ARG(thread);
 +      circuit = EVENT_ARG(thread);
        assert(circuit);
  
        circuit->t_send_psnp[1] = NULL;
        send_psnp(2, circuit);
  
        /* set next timer thread */
 -      thread_add_timer(master, send_l2_psnp, circuit,
 -                       isis_jitter(circuit->psnp_interval[1], PSNP_JITTER),
 -                       &circuit->t_send_psnp[1]);
 +      event_add_timer(master, send_l2_psnp, circuit,
 +                      isis_jitter(circuit->psnp_interval[1], PSNP_JITTER),
 +                      &circuit->t_send_psnp[1]);
  }
  
  /*
@@@ -2481,11 -2459,11 +2478,11 @@@ void send_lsp(struct isis_circuit *circ
        if (stream_get_endp(lsp->pdu) > stream_get_size(circuit->snd_stream)) {
                flog_err(
                        EC_ISIS_PACKET,
-                       "ISIS-Upd (%s): Can't send L%d LSP %s, seq 0x%08x, cksum 0x%04hx, lifetime %hus on %s. LSP Size is %zu while interface stream size is %zu.",
-                       circuit->area->area_tag, lsp->level,
-                       rawlspid_print(lsp->hdr.lsp_id), lsp->hdr.seqno,
-                       lsp->hdr.checksum, lsp->hdr.rem_lifetime,
-                       circuit->interface->name, stream_get_endp(lsp->pdu),
+                       "ISIS-Upd (%s): Can't send L%d LSP %pLS, seq 0x%08x, cksum 0x%04hx, lifetime %hus on %s. LSP Size is %zu while interface stream size is %zu.",
+                       circuit->area->area_tag, lsp->level, lsp->hdr.lsp_id,
+                       lsp->hdr.seqno, lsp->hdr.checksum,
+                       lsp->hdr.rem_lifetime, circuit->interface->name,
+                       stream_get_endp(lsp->pdu),
                        stream_get_size(circuit->snd_stream));
  #ifndef FABRICD
                /* send a northbound notification */
        }
  
        if (IS_DEBUG_UPDATE_PACKETS) {
-               zlog_debug("ISIS-Upd (%s): Sending %sL%d LSP %s, seq 0x%08x, cksum 0x%04hx, lifetime %hus on %s",
-                          circuit->area->area_tag,
-                          (tx_type == TX_LSP_CIRCUIT_SCOPED)
-                               ? "Circuit scoped " : "",
-                          lsp->level,
-                          rawlspid_print(lsp->hdr.lsp_id), lsp->hdr.seqno,
-                          lsp->hdr.checksum, lsp->hdr.rem_lifetime,
-                          circuit->interface->name);
+               zlog_debug(
+                       "ISIS-Upd (%s): Sending %sL%d LSP %pLS, seq 0x%08x, cksum 0x%04hx, lifetime %hus on %s",
+                       circuit->area->area_tag,
+                       (tx_type == TX_LSP_CIRCUIT_SCOPED) ? "Circuit scoped "
+                                                          : "",
+                       lsp->level, lsp->hdr.lsp_id, lsp->hdr.seqno,
+                       lsp->hdr.checksum, lsp->hdr.rem_lifetime,
+                       circuit->interface->name);
                if (IS_DEBUG_PACKET_DUMP)
                        zlog_dump_data(STREAM_DATA(circuit->snd_stream),
                                       stream_get_endp(circuit->snd_stream));
diff --combined isisd/isis_snmp.c
index 6d9974fe9fe0ade1c8b7fe9ea421c3e454e3b525,46c56041790aaecc5a09bccffc4b2beabe653db4..f9e3780e29e3c78ffcb34a038bdf8139fd5af266
  /* Declare static local variables for convenience. */
  SNMP_LOCAL_VARIABLES
  
 -/* If ARRAY_SIZE is not available use a primitive substitution */
 -#ifndef ARRAY_SIZE
 -#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
 -#endif
 -
  /*
   * Define time function, it serves two purposes
   * 1. Uses unint32_t for unix time and encapsulates
@@@ -420,7 -425,7 +420,7 @@@ static struct isis_func_to_prefix isis_
        {isis_snmp_find_isadj_ipaddr, {ISIS_ISADJIPADDR_ENTRY}, 4},
        {isis_snmp_find_isadj_prot_supp, {ISIS_ISADJPROTSUPP_ENTRY}, 4},
  };
 -static size_t isis_func_to_prefix_count = ARRAY_SIZE(isis_func_to_prefix_arr);
 +static size_t isis_func_to_prefix_count = array_size(isis_func_to_prefix_arr);
  
  static struct variable isis_var_arr[] = {
        {ISIS_SYS_VERSION, INTEGER, RONLY, isis_snmp_find_sys_object},
         isis_snmp_find_isadj_prot_supp},
  };
  
 -static const size_t isis_var_count = ARRAY_SIZE(isis_var_arr);
 +static const size_t isis_var_count = array_size(isis_var_arr);
  
  /* Minimal set of hard-coded data */
  #define ISIS_VERSION (1)
@@@ -833,12 -838,12 +833,12 @@@ static int isis_snmp_conv_next(uint8_t 
   */
  static int isis_snmp_area_addr_lookup_exact(oid *oid_idx, size_t oid_idx_len,
                                            struct isis_area **ret_area,
-                                           struct area_addr **ret_addr)
+                                           struct iso_address **ret_addr)
  {
        uint8_t cmp_buf[ISIS_SNMP_OSI_ADDR_LEN_MAX];
        size_t addr_len;
        struct isis_area *area = NULL;
-       struct area_addr *addr = NULL;
+       struct iso_address *addr = NULL;
        struct listnode *addr_node;
        struct isis *isis = isis_lookup_by_vrfid(VRF_DEFAULT);
  
  
  static int isis_snmp_area_addr_lookup_next(oid *oid_idx, size_t oid_idx_len,
                                           struct isis_area **ret_area,
-                                          struct area_addr **ret_addr)
+                                          struct iso_address **ret_addr)
  {
        uint8_t cmp_buf[ISIS_SNMP_OSI_ADDR_LEN_MAX];
        size_t addr_len;
        int try_exact = 0;
        struct isis_area *found_area = NULL;
        struct isis_area *area = NULL;
-       struct area_addr *found_addr = NULL;
-       struct area_addr *addr = NULL;
+       struct iso_address *found_addr = NULL;
+       struct iso_address *addr = NULL;
        struct listnode *addr_node;
        struct isis *isis = isis_lookup_by_vrfid(VRF_DEFAULT);
  
@@@ -1501,7 -1506,7 +1501,7 @@@ static uint8_t *isis_snmp_find_man_area
                                        WriteMethod **write_method)
  {
        int res;
-       struct area_addr *area_addr = NULL;
+       struct iso_address *area_addr = NULL;
        oid *oid_idx;
        size_t oid_idx_len;
        size_t off = 0;
@@@ -2485,6 -2490,11 +2485,11 @@@ static uint8_t *isis_snmp_find_isadj(st
        uint32_t delta_ticks;
        time_t now_time;
  
+       /* Ring buffer to print SNPA */
+ #define FORMAT_BUF_COUNT 4
+       static char snpa[FORMAT_BUF_COUNT][ISO_SYSID_STRLEN];
+       static size_t cur_buf = 0;
        *write_method = NULL;
  
        if (*length <= v->namelen) {
                return SNMP_INTEGER(adj->threeway_state);
  
        case ISIS_ISADJ_NEIGHSNPAADDRESS: {
-               const char *snpa = (char *)snpa_print(adj->snpa);
-               *var_len = strlen(snpa);
-               return (uint8_t *)snpa;
+               cur_buf = (cur_buf + 1) % FORMAT_BUF_COUNT;
+               snprintfrr(snpa[cur_buf], ISO_SYSID_STRLEN, "%pSY", adj->snpa);
+               *var_len = strlen(snpa[cur_buf]);
+               return (uint8_t *)snpa[cur_buf];
        }
  
        case ISIS_ISADJ_NEIGHSYSTYPE:
@@@ -2792,7 -2803,7 +2798,7 @@@ static uint8_t *isis_snmp_find_isadj_pr
  
  
  /* Register ISIS-MIB. */
 -static int isis_snmp_init(struct thread_master *tm)
 +static int isis_snmp_init(struct event_loop *tm)
  {
        struct isis_func_to_prefix *h2f = isis_func_to_prefix_arr;
        struct variable *v;
@@@ -2854,7 -2865,7 +2860,7 @@@ static int isis_snmp_db_overload_update
  
        /* Put in trap value */
        snmp_varlist_add_variable(&notification_vars, isis_snmp_trap_var,
 -                                ARRAY_SIZE(isis_snmp_trap_var), ASN_OBJECT_ID,
 +                                array_size(isis_snmp_trap_var), ASN_OBJECT_ID,
                                  (uint8_t *)&isis_snmp_trap_val_db_overload,
                                  sizeof(isis_snmp_trap_val_db_overload));
  
  
        snmp_varlist_add_variable(
                &notification_vars, isis_snmp_trap_data_var_sys_level_index,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_sys_level_index), INTEGER,
 +              array_size(isis_snmp_trap_data_var_sys_level_index), INTEGER,
                (uint8_t *)&val, sizeof(val));
  
        /* Patch sys_level_state with proper index */
 -      off = ARRAY_SIZE(isis_snmp_trap_data_var_sys_level_state) - 1;
 +      off = array_size(isis_snmp_trap_data_var_sys_level_state) - 1;
        isis_snmp_trap_data_var_sys_level_state[off] = val;
  
        /* Prepare data */
  
        snmp_varlist_add_variable(
                &notification_vars, isis_snmp_trap_data_var_sys_level_state,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_sys_level_state), INTEGER,
 +              array_size(isis_snmp_trap_data_var_sys_level_state), INTEGER,
                (uint8_t *)&val, sizeof(val));
  
        send_v2trap(notification_vars);
@@@ -2900,7 -2911,7 +2906,7 @@@ static int isis_snmp_lsp_exceed_max_upd
  
        /* Put in trap value */
        snmp_varlist_add_variable(&notification_vars, isis_snmp_trap_var,
 -                                ARRAY_SIZE(isis_snmp_trap_var), ASN_OBJECT_ID,
 +                                array_size(isis_snmp_trap_var), ASN_OBJECT_ID,
                                  (uint8_t *)&isis_snmp_trap_val_lsp_exceed_max,
                                  sizeof(isis_snmp_trap_val_lsp_exceed_max));
  
  
        snmp_varlist_add_variable(
                &notification_vars, isis_snmp_trap_data_var_sys_level_index,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_sys_level_index), INTEGER,
 +              array_size(isis_snmp_trap_data_var_sys_level_index), INTEGER,
                (uint8_t *)&val, sizeof(val));
  
        snmp_varlist_add_variable(
                &notification_vars, isis_snmp_trap_data_var_pdu_lsp_id,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_pdu_lsp_id), STRING, lsp_id,
 +              array_size(isis_snmp_trap_data_var_pdu_lsp_id), STRING, lsp_id,
                ISIS_SYS_ID_LEN + 2);
  
        send_v2trap(notification_vars);
@@@ -2957,18 -2968,18 +2963,18 @@@ static void isis_snmp_update_worker_a(c
        /* Put in trap value */
        memcpy(var_name, isis_snmp_notifications,
               sizeof(isis_snmp_notifications));
 -      var_count = ARRAY_SIZE(isis_snmp_notifications);
 +      var_count = array_size(isis_snmp_notifications);
        var_name[var_count++] = trap_id;
  
        /* Put in trap value */
        snmp_varlist_add_variable(&notification_vars, isis_snmp_trap_var,
 -                                ARRAY_SIZE(isis_snmp_trap_var), ASN_OBJECT_ID,
 +                                array_size(isis_snmp_trap_var), ASN_OBJECT_ID,
                                  (uint8_t *)var_name, var_count * sizeof(oid));
  
        val = circuit->is_type;
        snmp_varlist_add_variable(
                &notification_vars, isis_snmp_trap_data_var_sys_level_index,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_sys_level_index), INTEGER,
 +              array_size(isis_snmp_trap_data_var_sys_level_index), INTEGER,
                (uint8_t *)&val, sizeof(val));
  
        if (oid_a_len != 0) {
  
        snmp_varlist_add_variable(
                &notification_vars, isis_snmp_trap_data_var_circ_if_index,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_circ_if_index), UNSIGNED32,
 +              array_size(isis_snmp_trap_data_var_circ_if_index), UNSIGNED32,
                (uint8_t *)&val, sizeof(val));
  
  
@@@ -3037,18 -3048,18 +3043,18 @@@ static void isis_snmp_update_worker_b(c
        /* Put in trap value */
        memcpy(var_name, isis_snmp_notifications,
               sizeof(isis_snmp_notifications));
 -      var_count = ARRAY_SIZE(isis_snmp_notifications);
 +      var_count = array_size(isis_snmp_notifications);
        var_name[var_count++] = trap_id;
  
        /* Put in trap value */
        snmp_varlist_add_variable(&notification_vars, isis_snmp_trap_var,
 -                                ARRAY_SIZE(isis_snmp_trap_var), ASN_OBJECT_ID,
 +                                array_size(isis_snmp_trap_var), ASN_OBJECT_ID,
                                  (uint8_t *)var_name, var_count * sizeof(oid));
  
        val = circuit->is_type;
        snmp_varlist_add_variable(
                &notification_vars, isis_snmp_trap_data_var_sys_level_index,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_sys_level_index), INTEGER,
 +              array_size(isis_snmp_trap_data_var_sys_level_index), INTEGER,
                (uint8_t *)&val, sizeof(val));
  
        if (circuit->interface == NULL)
  
        snmp_varlist_add_variable(
                &notification_vars, isis_snmp_trap_data_var_circ_if_index,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_circ_if_index), UNSIGNED32,
 +              array_size(isis_snmp_trap_data_var_circ_if_index), UNSIGNED32,
                (uint8_t *)&val, sizeof(val));
  
  
@@@ -3103,9 -3114,9 +3109,9 @@@ static int isis_snmp_id_len_mismatch_up
        isis_snmp_update_worker_a(
                circuit, ISIS_TRAP_ID_LEN_MISMATCH,
                isis_snmp_trap_data_var_pdu_field_len,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_pdu_field_len), UNSIGNED32,
 +              array_size(isis_snmp_trap_data_var_pdu_field_len), UNSIGNED32,
                &val, sizeof(val), isis_snmp_trap_data_var_pdu_fragment,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_pdu_fragment), STRING,
 +              array_size(isis_snmp_trap_data_var_pdu_fragment), STRING,
                raw_pdu, raw_pdu_len);
        return 0;
  }
@@@ -3128,10 -3139,10 +3134,10 @@@ isis_snmp_max_area_addr_mismatch_update
        isis_snmp_update_worker_a(
                circuit, ISIS_TRAP_MAX_AREA_ADDR_MISMATCH,
                isis_snmp_trap_data_var_pdu_max_area_addr,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_pdu_max_area_addr),
 +              array_size(isis_snmp_trap_data_var_pdu_max_area_addr),
                UNSIGNED32, &val, sizeof(val),
                isis_snmp_trap_data_var_pdu_fragment,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_pdu_fragment), STRING,
 +              array_size(isis_snmp_trap_data_var_pdu_fragment), STRING,
                raw_pdu, raw_pdu_len);
        return 0;
  }
@@@ -3145,7 -3156,7 +3151,7 @@@ static int isis_snmp_own_lsp_purge_upda
        isis_snmp_update_worker_a(
                circuit, ISIS_TRAP_OWN_LSP_PURGE, NULL, 0, STRING, NULL, 0,
                isis_snmp_trap_data_var_pdu_lsp_id,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_pdu_lsp_id), STRING, lsp_id,
 +              array_size(isis_snmp_trap_data_var_pdu_lsp_id), STRING, lsp_id,
                ISIS_SYS_ID_LEN + 2);
        return 0;
  }
@@@ -3159,7 -3170,7 +3165,7 @@@ static int isis_snmp_seqno_skipped_upda
        isis_snmp_update_worker_a(
                circuit, ISIS_TRAP_SEQNO_SKIPPED, NULL, 0, STRING, NULL, 0,
                isis_snmp_trap_data_var_pdu_lsp_id,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_pdu_lsp_id), STRING, lsp_id,
 +              array_size(isis_snmp_trap_data_var_pdu_lsp_id), STRING, lsp_id,
                ISIS_SYS_ID_LEN + 2);
        return 0;
  }
@@@ -3178,7 -3189,7 +3184,7 @@@ isis_snmp_authentication_type_failure_u
        isis_snmp_update_worker_a(
                circuit, ISIS_TRAP_AUTHEN_TYPE_FAILURE, NULL, 0, STRING, NULL,
                0, isis_snmp_trap_data_var_pdu_fragment,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_pdu_fragment), STRING,
 +              array_size(isis_snmp_trap_data_var_pdu_fragment), STRING,
                raw_pdu, raw_pdu_len);
        return 0;
  }
@@@ -3196,7 -3207,7 +3202,7 @@@ isis_snmp_authentication_failure_update
        isis_snmp_update_worker_a(
                circuit, ISIS_TRAP_AUTHEN_FAILURE, NULL, 0, STRING, NULL, 0,
                isis_snmp_trap_data_var_pdu_fragment,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_pdu_fragment), STRING,
 +              array_size(isis_snmp_trap_data_var_pdu_fragment), STRING,
                raw_pdu, raw_pdu_len);
        return 0;
  }
@@@ -3218,9 -3229,9 +3224,9 @@@ static int isis_snmp_version_skew_updat
        isis_snmp_update_worker_b(
                circuit, ISIS_TRAP_VERSION_SKEW,
                isis_snmp_trap_data_var_pdu_proto_ver,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_pdu_proto_ver), UNSIGNED32,
 +              array_size(isis_snmp_trap_data_var_pdu_proto_ver), UNSIGNED32,
                &val, sizeof(val), isis_snmp_trap_data_var_pdu_fragment,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_pdu_fragment), STRING,
 +              array_size(isis_snmp_trap_data_var_pdu_fragment), STRING,
                raw_pdu, raw_pdu_len);
        return 0;
  }
@@@ -3243,7 -3254,7 +3249,7 @@@ static int isis_snmp_area_mismatch_upda
  
        /* Put in trap value */
        snmp_varlist_add_variable(&notification_vars, isis_snmp_trap_var,
 -                                ARRAY_SIZE(isis_snmp_trap_var), ASN_OBJECT_ID,
 +                                array_size(isis_snmp_trap_var), ASN_OBJECT_ID,
                                  (uint8_t *)&isis_snmp_trap_val_area_mismatch,
                                  sizeof(isis_snmp_trap_val_area_mismatch));
  
  
        snmp_varlist_add_variable(
                &notification_vars, isis_snmp_trap_data_var_circ_if_index,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_circ_if_index), UNSIGNED32,
 +              array_size(isis_snmp_trap_data_var_circ_if_index), UNSIGNED32,
                (uint8_t *)&val, sizeof(val));
  
  
  
        snmp_varlist_add_variable(
                &notification_vars, isis_snmp_trap_data_var_pdu_fragment,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_pdu_fragment), STRING,
 +              array_size(isis_snmp_trap_data_var_pdu_fragment), STRING,
                raw_pdu, raw_pdu_len);
  
        send_v2trap(notification_vars);
@@@ -3287,7 -3298,7 +3293,7 @@@ static int isis_snmp_reject_adjacency_u
        isis_snmp_update_worker_a(
                circuit, ISIS_TRAP_REJ_ADJACENCY, NULL, 0, STRING, NULL, 0,
                isis_snmp_trap_data_var_pdu_fragment,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_pdu_fragment), STRING,
 +              array_size(isis_snmp_trap_data_var_pdu_fragment), STRING,
                raw_pdu, raw_pdu_len);
        return 0;
  }
@@@ -3302,9 -3313,9 +3308,9 @@@ static int isis_snmp_lsp_too_large_upda
        isis_snmp_update_worker_b(
                circuit, ISIS_TRAP_LSP_TOO_LARGE,
                isis_snmp_trap_data_var_pdu_lsp_size,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_pdu_lsp_size), UNSIGNED32,
 +              array_size(isis_snmp_trap_data_var_pdu_lsp_size), UNSIGNED32,
                &pdu_size, sizeof(pdu_size), isis_snmp_trap_data_var_pdu_lsp_id,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_pdu_lsp_id), STRING, lsp_id,
 +              array_size(isis_snmp_trap_data_var_pdu_lsp_id), STRING, lsp_id,
                ISIS_SYS_ID_LEN + 2);
        return 0;
  }
@@@ -3329,9 -3340,9 +3335,9 @@@ static int isis_snmp_adj_state_change_u
        isis_snmp_update_worker_b(
                adj->circuit, ISIS_TRAP_ADJ_STATE_CHANGE,
                isis_snmp_trap_data_var_pdu_lsp_id,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_pdu_lsp_id), STRING, lsp_id,
 +              array_size(isis_snmp_trap_data_var_pdu_lsp_id), STRING, lsp_id,
                ISIS_SYS_ID_LEN + 2, isis_snmp_trap_data_var_adj_state,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_adj_state), INTEGER, &val,
 +              array_size(isis_snmp_trap_data_var_adj_state), INTEGER, &val,
                sizeof(val));
        return 0;
  }
@@@ -3354,7 -3365,7 +3360,7 @@@ static int isis_snmp_lsp_error_update(c
  
        /* Put in trap value */
        snmp_varlist_add_variable(&notification_vars, isis_snmp_trap_var,
 -                                ARRAY_SIZE(isis_snmp_trap_var), ASN_OBJECT_ID,
 +                                array_size(isis_snmp_trap_var), ASN_OBJECT_ID,
                                  (uint8_t *)&isis_snmp_trap_val_lsp_error,
                                  sizeof(isis_snmp_trap_val_lsp_error));
  
  
        snmp_varlist_add_variable(
                &notification_vars, isis_snmp_trap_data_var_sys_level_index,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_sys_level_index), INTEGER,
 +              array_size(isis_snmp_trap_data_var_sys_level_index), INTEGER,
                (uint8_t *)&val, sizeof(val));
  
  
        snmp_varlist_add_variable(
                &notification_vars, isis_snmp_trap_data_var_pdu_lsp_id,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_pdu_lsp_id), STRING, lsp_id,
 +              array_size(isis_snmp_trap_data_var_pdu_lsp_id), STRING, lsp_id,
                ISIS_SYS_ID_LEN + 2);
  
        /* Prepare data */
  
        snmp_varlist_add_variable(
                &notification_vars, isis_snmp_trap_data_var_circ_if_index,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_circ_if_index), UNSIGNED32,
 +              array_size(isis_snmp_trap_data_var_circ_if_index), UNSIGNED32,
                (uint8_t *)&val, sizeof(val));
  
        /* Prepare data */
  
        snmp_varlist_add_variable(
                &notification_vars, isis_snmp_trap_data_var_pdu_fragment,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_pdu_fragment), STRING,
 +              array_size(isis_snmp_trap_data_var_pdu_fragment), STRING,
                raw_pdu, raw_pdu_len);
  
        /* Prepare data */
  
        snmp_varlist_add_variable(
                &notification_vars, isis_snmp_trap_data_var_error_offset,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_error_offset), UNSIGNED32,
 +              array_size(isis_snmp_trap_data_var_error_offset), UNSIGNED32,
                (uint8_t *)&val, sizeof(val));
  
        /* Prepare data */
  
        snmp_varlist_add_variable(
                &notification_vars, isis_snmp_trap_data_var_error_tlv_type,
 -              ARRAY_SIZE(isis_snmp_trap_data_var_error_tlv_type), UNSIGNED32,
 +              array_size(isis_snmp_trap_data_var_error_tlv_type), UNSIGNED32,
                (uint8_t *)&val, sizeof(val));
  
        send_v2trap(notification_vars);
diff --combined isisd/isis_spf.c
index bfe3758cd898d77e18aad50b3d08eb6a658616ab,b3f1268e9b2dce3e9c07fc4f47081665abedf2cd..8597049ac098a170981950637b3008fe534cfcb9
@@@ -11,7 -11,7 +11,7 @@@
  
  #include <zebra.h>
  
 -#include "thread.h"
 +#include "frrevent.h"
  #include "linklist.h"
  #include "vty.h"
  #include "log.h"
@@@ -241,7 -241,11 +241,7 @@@ void isis_vertex_del(struct isis_verte
  {
        list_delete(&vertex->Adj_N);
        list_delete(&vertex->parents);
 -      if (vertex->firsthops) {
 -              hash_clean(vertex->firsthops, NULL);
 -              hash_free(vertex->firsthops);
 -              vertex->firsthops = NULL;
 -      }
 +      hash_clean_and_free(&vertex->firsthops, NULL);
  
        memset(vertex, 0, sizeof(struct isis_vertex));
        XFREE(MTYPE_ISIS_VERTEX, vertex);
@@@ -367,7 -371,8 +367,7 @@@ struct isis_spftree *isis_spftree_new(s
  
  void isis_spftree_del(struct isis_spftree *spftree)
  {
 -      hash_clean(spftree->prefix_sids, NULL);
 -      hash_free(spftree->prefix_sids);
 +      hash_clean_and_free(&spftree->prefix_sids, NULL);
        isis_zebra_rlfa_unregister_all(spftree);
        isis_rlfa_list_clear(spftree);
        list_delete(&spftree->lfa.remote.pc_spftrees);
@@@ -1067,8 -1072,8 +1067,8 @@@ end
            && !isis_level2_adj_up(spftree->area)) {
                struct prefix_pair ip_info = { {0} };
                if (IS_DEBUG_RTE_EVENTS)
-                       zlog_debug("ISIS-Spf (%s): add default %s route",
-                                  rawlspid_print(lsp->hdr.lsp_id),
+                       zlog_debug("ISIS-Spf (%pLS): add default %s route",
+                                  lsp->hdr.lsp_id,
                                   spftree->family == AF_INET ? "ipv4"
                                                              : "ipv6");
  
@@@ -1207,9 -1212,8 +1207,8 @@@ static void isis_spf_preload_tent(struc
  
                if (isis_lfa_excise_adj_check(spftree, adj_id)) {
                        if (IS_DEBUG_LFA)
-                               zlog_debug("ISIS-SPF: excising adjacency %s",
-                                          isis_format_id(sadj->id,
-                                                         ISIS_SYS_ID_LEN + 1));
+                               zlog_debug("ISIS-SPF: excising adjacency %pPN",
+                                          sadj->id);
                        continue;
                }
  
@@@ -1324,8 -1328,8 +1323,8 @@@ static void spf_adj_list_parse_tlv(stru
        LSP_FRAGMENT(lspid) = 0;
        lsp = lsp_search(spftree->lspdb, lspid);
        if (lsp == NULL || lsp->hdr.rem_lifetime == 0) {
-               zlog_warn("ISIS-SPF: No LSP found from root to L%d %s",
-                         spftree->level, rawlspid_print(lspid));
+               zlog_warn("ISIS-SPF: No LSP found from root to L%d %pLS",
+                         spftree->level, lspid);
                return;
        }
  
@@@ -1663,9 -1667,8 +1662,8 @@@ static void isis_spf_loop(struct isis_s
  
                lsp = lsp_for_vertex(spftree, vertex);
                if (!lsp) {
-                       zlog_warn("ISIS-SPF: No LSP found for %s",
-                                 isis_format_id(vertex->N.id,
-                                                sizeof(vertex->N.id)));
+                       zlog_warn("ISIS-SPF: No LSP found for %pPN",
+                                 vertex->N.id);
                        continue;
                }
  
@@@ -1853,9 -1856,9 +1851,9 @@@ void isis_spf_switchover_routes(struct 
                                      family, nexthop_ip, ifindex);
  }
  
 -static void isis_run_spf_cb(struct thread *thread)
 +static void isis_run_spf_cb(struct event *thread)
  {
 -      struct isis_spf_run *run = THREAD_ARG(thread);
 +      struct isis_spf_run *run = EVENT_ARG(thread);
        struct isis_area *area = run->area;
        int level = run->level;
        int have_run = 0;
@@@ -1950,7 -1953,7 +1948,7 @@@ int _isis_spf_schedule(struct isis_are
                        area->area_tag, level, diff, func, file, line);
        }
  
 -      THREAD_OFF(area->t_rlfa_rib_update);
 +      EVENT_OFF(area->t_rlfa_rib_update);
        if (area->spf_delay_ietf[level - 1]) {
                /* Need to call schedule function also if spf delay is running
                 * to
                if (area->spf_timer[level - 1])
                        return ISIS_OK;
  
 -              thread_add_timer_msec(master, isis_run_spf_cb,
 -                                    isis_run_spf_arg(area, level), delay,
 -                                    &area->spf_timer[level - 1]);
 +              event_add_timer_msec(master, isis_run_spf_cb,
 +                                   isis_run_spf_arg(area, level), delay,
 +                                   &area->spf_timer[level - 1]);
                return ISIS_OK;
        }
  
                timer = area->min_spf_interval[level - 1] - diff;
        }
  
 -      thread_add_timer(master, isis_run_spf_cb, isis_run_spf_arg(area, level),
 -                       timer, &area->spf_timer[level - 1]);
 +      event_add_timer(master, isis_run_spf_cb, isis_run_spf_arg(area, level),
 +                      timer, &area->spf_timer[level - 1]);
  
        if (IS_DEBUG_SPF_EVENTS)
                zlog_debug("ISIS-SPF (%s) L%d SPF scheduled %ld sec from now",
diff --combined isisd/isis_sr.c
index cb330603e4198588eb1cc6b84e9f349f9f26dab5,9bbfcfe6d8b463d27c3ac1f1c8a48fd527ec7143..e43b84ab2e4d5385c20457cd31b801297a29d8b3
@@@ -1022,14 -1022,14 +1022,14 @@@ static void show_node(struct vty *vty, 
                if (!cap)
                        continue;
  
-               ttable_add_row(
-                       tt, "%s|%u - %u|%u - %u|%s|%u",
-                       sysid_print(lsp->hdr.lsp_id), cap->srgb.lower_bound,
-                       cap->srgb.lower_bound + cap->srgb.range_size - 1,
-                       cap->srlb.lower_bound,
-                       cap->srlb.lower_bound + cap->srlb.range_size - 1,
-                       cap->algo[0] == SR_ALGORITHM_SPF ? "SPF" : "S-SPF",
-                       cap->msd);
+               ttable_add_row(tt, "%pSY|%u - %u|%u - %u|%s|%u",
+                              lsp->hdr.lsp_id, cap->srgb.lower_bound,
+                              cap->srgb.lower_bound + cap->srgb.range_size - 1,
+                              cap->srlb.lower_bound,
+                              cap->srlb.lower_bound + cap->srlb.range_size - 1,
+                              cap->algo[0] == SR_ALGORITHM_SPF ? "SPF"
+                                                               : "S-SPF",
+                              cap->msd);
        }
  
        /* Dump the generated table. */
@@@ -1081,11 -1081,11 +1081,11 @@@ DEFUN(show_sr_node, show_sr_node_cmd
   *
   * @return            1 on success
   */
 -static void sr_start_label_manager(struct thread *start)
 +static void sr_start_label_manager(struct event *start)
  {
        struct isis_area *area;
  
 -      area = THREAD_ARG(start);
 +      area = EVENT_ARG(start);
  
        /* re-attempt to start SR & Label Manager connection */
        isis_sr_start(area);
@@@ -1108,8 -1108,8 +1108,8 @@@ int isis_sr_start(struct isis_area *are
        if (!isis_zebra_label_manager_ready())
                if (isis_zebra_label_manager_connect() < 0) {
                        /* Re-attempt to connect to Label Manager in 1 sec. */
 -                      thread_add_timer(master, sr_start_label_manager, area,
 -                                       1, &srdb->t_start_lm);
 +                      event_add_timer(master, sr_start_label_manager, area, 1,
 +                                      &srdb->t_start_lm);
                        return -1;
                }
  
@@@ -1168,7 -1168,7 +1168,7 @@@ void isis_sr_stop(struct isis_area *are
                 area->area_tag);
  
        /* Disable any re-attempt to connect to Label Manager */
 -      THREAD_OFF(srdb->t_start_lm);
 +      EVENT_OFF(srdb->t_start_lm);
  
        /* Uninstall all local Adjacency-SIDs. */
        for (ALL_LIST_ELEMENTS(area->srdb.adj_sids, node, nnode, sra))
diff --combined isisd/isis_te.c
index 3ecd2a6f65bff9870528e7bcad53688f6d20be55,48a9564ccb1fbafd894077080e4ea2ce731a47e9..4e180ead6189cd6a935e51abc8e08d2dae116127
@@@ -13,7 -13,7 +13,7 @@@
  #include <math.h>
  
  #include "linklist.h"
 -#include "thread.h"
 +#include "frrevent.h"
  #include "vty.h"
  #include "stream.h"
  #include "memory.h"
@@@ -903,7 -903,7 +903,7 @@@ static int lsp_to_edge_cb(const uint8_
        struct ls_edge *edge, *dst;
        struct ls_attributes *attr;
  
-       te_debug("  |- Process Extended IS for %s", sysid_print(id));
+       te_debug("  |- Process Extended IS for %pSY", id);
  
        /* Check parameters */
        if (old_metric || !args || !tlvs)
@@@ -1075,29 -1075,16 +1075,29 @@@ static int lsp_to_subnet_cb(const struc
        }
        if (!std)
                prefix_copy(&p, prefix);
 -      else
 +      else {
 +              /* Remove old subnet if any before prefix adjustment */
 +              subnet = ls_find_subnet(args->ted, prefix);
 +              if (subnet) {
 +                      if (args->export) {
 +                              subnet->status = DELETE;
 +                              isis_te_export(LS_MSG_TYPE_PREFIX, subnet);
 +                      }
 +                      te_debug("   |- Remove subnet with prefix %pFX",
 +                               &subnet->key);
 +                      ls_subnet_del_all(args->ted, subnet);
 +              }
                te_debug("   |- Adjust prefix %pFX with local address to: %pFX",
                         prefix, &p);
 +      }
  
        /* Search existing Subnet in TED ... */
 -      subnet = ls_find_subnet(args->ted, p);
 +      subnet = ls_find_subnet(args->ted, &p);
        /* ... and create a new Subnet if not found */
        if (!subnet) {
 -              ls_pref = ls_prefix_new(vertex->node->adv, p);
 +              ls_pref = ls_prefix_new(vertex->node->adv, &p);
                subnet = ls_subnet_add(args->ted, ls_pref);
 +              /* Stop processing if we are unable to create a new subnet */
                if (!subnet)
                        return LSP_ITER_CONTINUE;
        }
@@@ -1180,14 -1167,14 +1180,14 @@@ static void isis_te_parse_lsp(struct mp
  
        ted = mta->ted;
  
-       te_debug("ISIS-TE(%s): Parse LSP %s", lsp->area->area_tag,
-                sysid_print(lsp->hdr.lsp_id));
+       te_debug("ISIS-TE(%s): Parse LSP %pSY", lsp->area->area_tag,
+                lsp->hdr.lsp_id);
  
        /* First parse LSP to obtain the corresponding Vertex */
        vertex = lsp_to_vertex(ted, lsp);
        if (!vertex) {
-               zlog_warn("Unable to build Vertex from LSP %s. Abort!",
-                         sysid_print(lsp->hdr.lsp_id));
+               zlog_warn("Unable to build Vertex from LSP %pSY. Abort!",
+                         lsp->hdr.lsp_id);
                return;
        }
  
@@@ -1251,8 -1238,8 +1251,8 @@@ static void isis_te_delete_lsp(struct m
        if (!IS_MPLS_TE(mta) || !mta->ted || !lsp)
                return;
  
-       te_debug("ISIS-TE(%s): Delete Link State TED objects from LSP %s",
-                lsp->area->area_tag, sysid_print(lsp->hdr.lsp_id));
+       te_debug("ISIS-TE(%s): Delete Link State TED objects from LSP %pSY",
+                lsp->area->area_tag, lsp->hdr.lsp_id);
  
        /* Compute Link State Node ID from IS-IS sysID ... */
        if (lsp->level == ISIS_LEVEL1)
@@@ -1835,7 -1822,7 +1835,7 @@@ static int show_ted(struct vty *vty, st
                                return CMD_WARNING_CONFIG_FAILED;
                        }
                        /* Get the Subnet from the Link State Database */
 -                      subnet = ls_find_subnet(ted, pref);
 +                      subnet = ls_find_subnet(ted, &pref);
                        if (!subnet) {
                                vty_out(vty, "No subnet found for ID %pFX\n",
                                        &pref);
                                return CMD_WARNING_CONFIG_FAILED;
                        }
                        /* Get the Subnet from the Link State Database */
 -                      subnet = ls_find_subnet(ted, pref);
 +                      subnet = ls_find_subnet(ted, &pref);
                        if (!subnet) {
                                vty_out(vty, "No subnet found for ID %pFX\n",
                                        &pref);
diff --combined isisd/isis_tx_queue.c
index ec2d50d60a47d643d504f06f8564bb681f07bee4,fef1c3f689c7d92824ebda0485b68b53a1e5be5c..caf97f11749c9315b6b5e33753e4af0c959c44cf
@@@ -32,7 -32,7 +32,7 @@@ struct isis_tx_queue_entry 
        struct isis_lsp *lsp;
        enum isis_tx_type type;
        bool is_retry;
 -      struct thread *retry;
 +      struct event *retry;
        struct isis_tx_queue *queue;
  };
  
@@@ -79,14 -79,15 +79,14 @@@ static void tx_queue_element_free(void 
  {
        struct isis_tx_queue_entry *e = element;
  
 -      THREAD_OFF(e->retry);
 +      EVENT_OFF(e->retry);
  
        XFREE(MTYPE_TX_QUEUE_ENTRY, e);
  }
  
  void isis_tx_queue_free(struct isis_tx_queue *queue)
  {
 -      hash_clean(queue->hash, tx_queue_element_free);
 -      hash_free(queue->hash);
 +      hash_clean_and_free(&queue->hash, tx_queue_element_free);
        XFREE(MTYPE_TX_QUEUE, queue);
  }
  
@@@ -100,12 -101,12 +100,12 @@@ static struct isis_tx_queue_entry *tx_q
        return hash_lookup(queue->hash, &e);
  }
  
 -static void tx_queue_send_event(struct thread *thread)
 +static void tx_queue_send_event(struct event *thread)
  {
 -      struct isis_tx_queue_entry *e = THREAD_ARG(thread);
 +      struct isis_tx_queue_entry *e = EVENT_ARG(thread);
        struct isis_tx_queue *queue = e->queue;
  
 -      thread_add_timer(master, tx_queue_send_event, e, 5, &e->retry);
 +      event_add_timer(master, tx_queue_send_event, e, 5, &e->retry);
  
        if (e->is_retry)
                queue->circuit->area->lsp_rxmt_count++;
@@@ -126,12 -127,12 +126,12 @@@ void _isis_tx_queue_add(struct isis_tx_
                return;
  
        if (IS_DEBUG_TX_QUEUE) {
-               zlog_debug("Add LSP %s to %s queue as %s LSP. (From %s %s:%d)",
-                          rawlspid_print(lsp->hdr.lsp_id),
-                          queue->circuit->interface->name,
-                          (type == TX_LSP_CIRCUIT_SCOPED) ?
-                          "circuit scoped" : "regular",
-                          func, file, line);
+               zlog_debug(
+                       "Add LSP %pLS to %s queue as %s LSP. (From %s %s:%d)",
+                       lsp->hdr.lsp_id, queue->circuit->interface->name,
+                       (type == TX_LSP_CIRCUIT_SCOPED) ? "circuit scoped"
+                                                       : "regular",
+                       func, file, line);
        }
  
        struct isis_tx_queue_entry *e = tx_queue_find(queue, lsp);
  
        e->type = type;
  
 -      THREAD_OFF(e->retry);
 -      thread_add_event(master, tx_queue_send_event, e, 0, &e->retry);
 +      EVENT_OFF(e->retry);
 +      event_add_event(master, tx_queue_send_event, e, 0, &e->retry);
  
        e->is_retry = false;
  }
@@@ -164,13 -165,12 +164,12 @@@ void _isis_tx_queue_del(struct isis_tx_
                return;
  
        if (IS_DEBUG_TX_QUEUE) {
-               zlog_debug("Remove LSP %s from %s queue. (From %s %s:%d)",
-                          rawlspid_print(lsp->hdr.lsp_id),
-                          queue->circuit->interface->name,
+               zlog_debug("Remove LSP %pLS from %s queue. (From %s %s:%d)",
+                          lsp->hdr.lsp_id, queue->circuit->interface->name,
                           func, file, line);
        }
  
 -      THREAD_OFF(e->retry);
 +      EVENT_OFF(e->retry);
  
        hash_release(queue->hash, e);
        XFREE(MTYPE_TX_QUEUE_ENTRY, e);
diff --combined isisd/isisd.c
index c6369a884e3b626ed23804616aabe17489da0cbf,51ece8ebe54a5f8a14180f3869d3390fbb6968f5..fd6b91b42e1f5af10874940d15281e660ddd3736
@@@ -9,7 -9,7 +9,7 @@@
  
  #include <zebra.h>
  
 -#include "thread.h"
 +#include "frrevent.h"
  #include "vty.h"
  #include "command.h"
  #include "log.h"
@@@ -88,7 -88,7 +88,7 @@@ static struct isis_master isis_master
  struct isis_master *im;
  
  /* ISIS config processing thread */
 -struct thread *t_isis_cfg;
 +struct event *t_isis_cfg;
  
  #ifndef FABRICD
  DEFINE_HOOK(isis_hook_db_overload, (const struct isis_area *area), (area));
@@@ -166,7 -166,7 +166,7 @@@ struct isis *isis_lookup_by_sysid(cons
        return NULL;
  }
  
 -void isis_master_init(struct thread_master *master)
 +void isis_master_init(struct event_loop *master)
  {
        memset(&isis_master, 0, sizeof(isis_master));
        im = &isis_master;
@@@ -272,7 -272,7 +272,7 @@@ void isis_area_del_circuit(struct isis_
  
  static void delete_area_addr(void *arg)
  {
-       struct area_addr *addr = (struct area_addr *)arg;
+       struct iso_address *addr = (struct iso_address *)arg;
  
        XFREE(MTYPE_ISIS_AREA_ADDR, addr);
  }
@@@ -325,7 -325,7 +325,7 @@@ struct isis_area *isis_area_create(cons
        area->area_addrs->del = delete_area_addr;
  
        if (!CHECK_FLAG(im->options, F_ISIS_UNIT_TEST))
 -              thread_add_timer(master, lsp_tick, area, 1, &area->t_tick);
 +              event_add_timer(master, lsp_tick, area, 1, &area->t_tick);
        flags_initialize(&area->flags);
  
        isis_sr_area_init(area);
@@@ -519,11 -519,11 +519,11 @@@ void isis_area_destroy(struct isis_are
        spftree_area_del(area);
  
        if (area->spf_timer[0])
 -              isis_spf_timer_free(THREAD_ARG(area->spf_timer[0]));
 -      THREAD_OFF(area->spf_timer[0]);
 +              isis_spf_timer_free(EVENT_ARG(area->spf_timer[0]));
 +      EVENT_OFF(area->spf_timer[0]);
        if (area->spf_timer[1])
 -              isis_spf_timer_free(THREAD_ARG(area->spf_timer[1]));
 -      THREAD_OFF(area->spf_timer[1]);
 +              isis_spf_timer_free(EVENT_ARG(area->spf_timer[1]));
 +      EVENT_OFF(area->spf_timer[1]);
  
        spf_backoff_free(area->spf_delay_ietf[0]);
        spf_backoff_free(area->spf_delay_ietf[1]);
        isis_lfa_tiebreakers_clear(area, ISIS_LEVEL1);
        isis_lfa_tiebreakers_clear(area, ISIS_LEVEL2);
  
 -      THREAD_OFF(area->t_tick);
 -      THREAD_OFF(area->t_lsp_refresh[0]);
 -      THREAD_OFF(area->t_lsp_refresh[1]);
 -      THREAD_OFF(area->t_rlfa_rib_update);
 +      EVENT_OFF(area->t_tick);
 +      EVENT_OFF(area->t_lsp_refresh[0]);
 +      EVENT_OFF(area->t_lsp_refresh[1]);
 +      EVENT_OFF(area->t_rlfa_rib_update);
  
 -      thread_cancel_event(master, area);
 +      event_cancel_event(master, area);
  
        listnode_delete(area->isis->area_list, area);
  
@@@ -809,8 -809,8 +809,8 @@@ static void area_set_mt_overload(struc
  int area_net_title(struct vty *vty, const char *net_title)
  {
        VTY_DECLVAR_CONTEXT(isis_area, area);
-       struct area_addr *addr;
-       struct area_addr *addrp;
+       struct iso_address *addr;
+       struct iso_address *addrp;
        struct listnode *node;
  
        uint8_t buff[255];
                return CMD_ERR_NOTHING_TODO;
        }
  
-       addr = XMALLOC(MTYPE_ISIS_AREA_ADDR, sizeof(struct area_addr));
+       addr = XMALLOC(MTYPE_ISIS_AREA_ADDR, sizeof(struct iso_address));
        addr->addr_len = dotformat2buff(buff, net_title);
        memcpy(addr->area_addr, buff, addr->addr_len);
  #ifdef EXTREME_DEBUG
        zlog_debug("added area address %s for area %s (address length %d)",
                   net_title, area->area_tag, addr->addr_len);
  #endif /* EXTREME_DEBUG */
-       if (addr->addr_len < 8 || addr->addr_len > 20) {
+       if (addr->addr_len < ISO_ADDR_MIN || addr->addr_len > ISO_ADDR_SIZE) {
                vty_out(vty,
                        "area address must be at least 8..20 octets long (%d)\n",
                        addr->addr_len);
                memcpy(area->isis->sysid, GETSYSID(addr), ISIS_SYS_ID_LEN);
                area->isis->sysid_set = 1;
                if (IS_DEBUG_EVENTS)
-                       zlog_debug("Router has SystemID %s",
-                                  sysid_print(area->isis->sysid));
+                       zlog_debug("Router has SystemID %pSY",
+                                  area->isis->sysid);
        } else {
                /*
                 * Check that the SystemID portions match
  int area_clear_net_title(struct vty *vty, const char *net_title)
  {
        VTY_DECLVAR_CONTEXT(isis_area, area);
-       struct area_addr addr, *addrp = NULL;
+       struct iso_address addr, *addrp = NULL;
        struct listnode *node;
        uint8_t buff[255];
  
        addr.addr_len = dotformat2buff(buff, net_title);
-       if (addr.addr_len < 8 || addr.addr_len > 20) {
+       if (addr.addr_len < ISO_ADDR_MIN || addr.addr_len > ISO_ADDR_SIZE) {
                vty_out(vty,
                        "Unsupported area address length %d, should be 8...20 \n",
                        addr.addr_len);
@@@ -2250,7 -2250,7 +2250,7 @@@ static void isis_spf_ietf_common(struc
                        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
@@@ -2348,11 -2348,11 +2348,11 @@@ static void common_isis_summary_json(st
        time_t cur;
        char uptime[MONOTIME_STRLEN];
        char stier[5];
        json_object_string_add(json, "vrf", isis->name);
        json_object_int_add(json, "process-id", isis->process_id);
        if (isis->sysid_set)
-               json_object_string_add(json, "system-id",
-                                      sysid_print(isis->sysid));
+               json_object_string_addf(json, "system-id", "%pSY", isis->sysid);
  
        cur = time(NULL);
        cur -= isis->uptime;
                }
  
                if (listcount(area->area_addrs) > 0) {
-                       struct area_addr *area_addr;
+                       struct iso_address *area_addr;
                        for (ALL_LIST_ELEMENTS_RO(area->area_addrs, node2,
-                                                 area_addr)) {
-                               json_object_string_add(
-                                       area_json, "net",
-                                       isonet_print(area_addr->area_addr,
-                                                    area_addr->addr_len +
-                                                            ISIS_SYS_ID_LEN +
-                                                            1));
-                       }
+                                                 area_addr))
+                               json_object_string_addf(area_json, "net",
+                                                       "%pISl", area_addr);
                }
  
                tx_pdu_json = json_object_new_object();
@@@ -2462,8 -2457,7 +2457,7 @@@ static void common_isis_summary_vty(str
        vty_out(vty, "vrf             : %s\n", isis->name);
        vty_out(vty, "Process Id      : %ld\n", isis->process_id);
        if (isis->sysid_set)
-               vty_out(vty, "System Id       : %s\n",
-                       sysid_print(isis->sysid));
+               vty_out(vty, "System Id       : %pSY\n", isis->sysid);
  
        vty_out(vty, "Up time         : ");
        vty_out_timestr(vty, isis->uptime);
                }
  
                if (listcount(area->area_addrs) > 0) {
-                       struct area_addr *area_addr;
+                       struct iso_address *area_addr;
                        for (ALL_LIST_ELEMENTS_RO(area->area_addrs, node2,
-                                                 area_addr)) {
-                               vty_out(vty, "  Net: %s\n",
-                                       isonet_print(area_addr->area_addr,
-                                                    area_addr->addr_len
-                                                            + ISIS_SYS_ID_LEN
-                                                            + 1));
-                       }
+                                                 area_addr))
+                               vty_out(vty, "  Net: %pISl\n", area_addr);
                }
  
                vty_out(vty, "  TX counters per PDU type:\n");
                vty_out(vty, "  RX counters per PDU type:\n");
                pdu_counter_print(vty, "    ", area->pdu_rx_counters);
  
 +              vty_out(vty, "  Drop counters per PDU type:\n");
 +              pdu_counter_print(vty, "    ", area->pdu_drop_counters);
 +
                vty_out(vty, "  Advertise high metrics: %s\n",
                        area->advertise_high_metrics ? "Enabled" : "Disabled");
  
@@@ -3122,14 -3108,14 +3111,14 @@@ static void area_resign_level(struct is
        }
  
        if (area->spf_timer[level - 1])
 -              isis_spf_timer_free(THREAD_ARG(area->spf_timer[level - 1]));
 +              isis_spf_timer_free(EVENT_ARG(area->spf_timer[level - 1]));
  
 -      THREAD_OFF(area->spf_timer[level - 1]);
 +      EVENT_OFF(area->spf_timer[level - 1]);
  
        sched_debug(
                "ISIS (%s): Resigned from L%d - canceling LSP regeneration timer.",
                area->area_tag, level);
 -      THREAD_OFF(area->t_lsp_refresh[level - 1]);
 +      EVENT_OFF(area->t_lsp_refresh[level - 1]);
        area->lsp_regenerate_pending[level - 1] = 0;
  }
  
@@@ -3218,7 -3204,7 +3207,7 @@@ void isis_area_overload_bit_set(struct 
                } else {
                        /* Cancel overload on startup timer if it's running */
                        if (area->t_overload_on_startup_timer) {
 -                              THREAD_OFF(area->t_overload_on_startup_timer);
 +                              EVENT_OFF(area->t_overload_on_startup_timer);
                                area->t_overload_on_startup_timer = NULL;
                        }
                }
@@@ -3497,15 -3483,10 +3486,10 @@@ static int isis_config_write(struct vt
                        write++;
                        /* ISIS - Net */
                        if (listcount(area->area_addrs) > 0) {
-                               struct area_addr *area_addr;
+                               struct iso_address *area_addr;
                                for (ALL_LIST_ELEMENTS_RO(area->area_addrs,
                                                          node2, area_addr)) {
-                                       vty_out(vty, " net %s\n",
-                                               isonet_print(
-                                                       area_addr->area_addr,
-                                                       area_addr->addr_len
-                                                               + ISIS_SYS_ID_LEN
-                                                               + 1));
+                                       vty_out(vty, " net %pISl\n", area_addr);
                                        write++;
                                }
                        }
diff --combined isisd/isisd.h
index 0b1f1cb620c18e85b5e461297b135453cbef890a,37738a92cfc5db34c248ce6f509adea5038a0514..454876b7b0276450cd968acd5f50582181058215
@@@ -24,6 -24,7 +24,7 @@@
  #include "isis_lfa.h"
  #include "qobj.h"
  #include "ldp_sync.h"
+ #include "iso.h"
  
  DECLARE_MGROUP(ISISD);
  
@@@ -71,7 -72,7 +72,7 @@@ struct isis_master 
        /* ISIS instance. */
        struct list *isis;
        /* ISIS thread master. */
 -      struct thread_master *master;
 +      struct event_loop *master;
        uint8_t options;
  };
  #define F_ISIS_UNIT_TEST 0x01
@@@ -87,9 -88,9 +88,9 @@@ struct isis 
        uint32_t router_id;             /* Router ID from zebra */
        struct list *area_list; /* list of IS-IS areas */
        uint8_t max_area_addrs;           /* maximumAreaAdresses */
-       struct area_addr *man_area_addrs; /* manualAreaAddresses */
+       struct iso_address *man_area_addrs; /* manualAreaAddresses */
        time_t uptime;                    /* when did we start */
 -      struct thread *t_dync_clean;      /* dynamic hostname cache cleanup thread */
 +      struct event *t_dync_clean; /* dynamic hostname cache cleanup thread */
        uint32_t circuit_ids_used[8];     /* 256 bits to track circuit ids 1 through 255 */
        int snmp_notifications;
        struct list *dyn_cache;
  
  extern struct isis_master *im;
  
 -extern struct thread *t_isis_cfg;
 +extern struct event *t_isis_cfg;
  
  enum spf_tree_id {
        SPFTREE_IPV4 = 0,
@@@ -129,11 -130,11 +130,11 @@@ struct isis_area 
        struct list *circuit_list; /* IS-IS circuits */
        struct list *adjacency_list; /* IS-IS adjacencies */
        struct flags flags;
 -      struct thread *t_tick; /* LSP walker */
 -      struct thread *t_lsp_refresh[ISIS_LEVELS];
 -      struct thread *t_overload_on_startup_timer;
 +      struct event *t_tick; /* LSP walker */
 +      struct event *t_lsp_refresh[ISIS_LEVELS];
 +      struct event *t_overload_on_startup_timer;
        struct timeval last_lsp_refresh_event[ISIS_LEVELS];
 -      struct thread *t_rlfa_rib_update;
 +      struct event *t_rlfa_rib_update;
        /* t_lsp_refresh is used in two ways:
         * a) regular refresh of LSPs
         * b) (possibly throttled) updates to LSPs
        struct spf_backoff *spf_delay_ietf[ISIS_LEVELS]; /*Structure with IETF
                                                            SPF algo
                                                            parameters*/
 -      struct thread *spf_timer[ISIS_LEVELS];
 +      struct event *spf_timer[ISIS_LEVELS];
  
        struct lsp_refresh_arg lsp_refresh_arg[ISIS_LEVELS];
  
        pdu_counter_t pdu_tx_counters;
        pdu_counter_t pdu_rx_counters;
 +      pdu_counter_t pdu_drop_counters;
        uint64_t lsp_rxmt_count;
  
        /* Area counters */
@@@ -253,7 -253,7 +254,7 @@@ DECLARE_MTYPE(ISIS_PLIST_NAME)
  DECLARE_HOOK(isis_area_overload_bit_update, (struct isis_area * area), (area));
  
  void isis_terminate(void);
 -void isis_master_init(struct thread_master *master);
 +void isis_master_init(struct event_loop *master);
  void isis_vrf_link(struct isis *isis, struct vrf *vrf);
  void isis_vrf_unlink(struct isis *isis, struct vrf *vrf);
  struct isis *isis_lookup_by_vrfid(vrf_id_t vrf_id);
@@@ -330,7 -330,7 +331,7 @@@ void config_end_lsp_generate(struct isi
  #define ISIS_SR               "/frr-isisd:isis/instance/segment-routing"
  
  /* Master of threads. */
 -extern struct thread_master *master;
 +extern struct event_loop *master;
  
  extern unsigned long debug_adj_pkt;
  extern unsigned long debug_snp_pkt;
diff --combined lib/link_state.c
index 0aba021b1af7f7597f051db7016b6226441fecb0,420290c03b18a40fc99d8878b68eafe74bc1f374..076030a83974ee00b061ff2258d967dcdc73aa76
@@@ -26,6 -26,7 +26,7 @@@
  #include "printfrr.h"
  #include <lib/json.h>
  #include "link_state.h"
+ #include "iso.h"
  
  /* Link State Memory allocation */
  DEFINE_MTYPE_STATIC(LIB, LS_DB, "Link State Database");
@@@ -333,7 -334,7 +334,7 @@@ int ls_attributes_same(struct ls_attrib
  /**
   *  Link State prefix management functions
   */
 -struct ls_prefix *ls_prefix_new(struct ls_node_id adv, struct prefix p)
 +struct ls_prefix *ls_prefix_new(struct ls_node_id adv, struct prefix *p)
  {
        struct ls_prefix *new;
  
  
        new = XCALLOC(MTYPE_LS_DB, sizeof(struct ls_prefix));
        new->adv = adv;
 -      new->pref = p;
 +      new->pref = *p;
  
        return new;
  }
@@@ -889,7 -890,7 +890,7 @@@ struct ls_subnet *ls_subnet_update(stru
        if (pref == NULL)
                return NULL;
  
 -      old = ls_find_subnet(ted, pref->pref);
 +      old = ls_find_subnet(ted, &pref->pref);
        if (old) {
                if (!ls_prefix_same(old->ls_pref, pref)) {
                        ls_prefix_del(old->ls_pref);
@@@ -942,12 -943,11 +943,12 @@@ void ls_subnet_del_all(struct ls_ted *t
        ls_subnet_del(ted, subnet);
  }
  
 -struct ls_subnet *ls_find_subnet(struct ls_ted *ted, const struct prefix prefix)
 +struct ls_subnet *ls_find_subnet(struct ls_ted *ted,
 +                               const struct prefix *prefix)
  {
        struct ls_subnet subnet = {};
  
 -      subnet.key = prefix;
 +      subnet.key = *prefix;
        return subnets_find(&ted->subnets, &subnet);
  }
  
@@@ -1847,7 -1847,7 +1848,7 @@@ struct ls_subnet *ls_msg2subnet(struct 
                        subnet->status = UPDATE;
                break;
        case LS_MSG_EVENT_DELETE:
 -              subnet = ls_find_subnet(ted, pref->pref);
 +              subnet = ls_find_subnet(ted, &pref->pref);
                if (subnet) {
                        if (delete)
                                ls_subnet_del_all(ted, subnet);
@@@ -1966,13 -1966,9 +1967,9 @@@ static const char *const status2txt[] 
  static const char *ls_node_id_to_text(struct ls_node_id lnid, char *str,
                                      size_t size)
  {
-       if (lnid.origin == ISIS_L1 || lnid.origin == ISIS_L2) {
-               uint8_t *id;
-               id = lnid.id.iso.sys_id;
-               snprintfrr(str, size, "%02x%02x.%02x%02x.%02x%02x", id[0],
-                          id[1], id[2], id[3], id[4], id[5]);
-       } else
+       if (lnid.origin == ISIS_L1 || lnid.origin == ISIS_L2)
+               snprintfrr(str, size, "%pSY", lnid.id.iso.sys_id);
+       else
                snprintfrr(str, size, "%pI4", &lnid.id.ip.addr);
  
        return str;
diff --combined lib/subdir.am
index 0f5bbef0b251c1650ef184c7d1d72ee1c8aa8937,df8f0f71375485d65ce2e6b935cfc65911c48abd..83eecbee577638db4a788202fa6d6f1520248bed
@@@ -38,6 -38,8 +38,6 @@@ lib_libfrr_la_SOURCES = 
        lib/frrscript.c \
        lib/frr_pthread.c \
        lib/frrstr.c \
 -      lib/getopt.c \
 -      lib/getopt1.c \
        lib/grammar_sandbox.c \
        lib/graph.c \
        lib/hash.c \
@@@ -47,6 -49,7 +47,7 @@@
        lib/if_rmap.c \
        lib/imsg-buffer.c \
        lib/imsg.c \
+       lib/iso.c \
        lib/jhash.c \
        lib/json.c \
        lib/keychain.c \
@@@ -62,9 -65,6 +63,9 @@@
        lib/log_vty.c \
        lib/md5.c \
        lib/memory.c \
 +      lib/mgmt_be_client.c \
 +      lib/mgmt_fe_client.c \
 +      lib/mgmt_msg.c \
        lib/mlag.c \
        lib/module.c \
        lib/mpls.c \
        lib/systemd.c \
        lib/table.c \
        lib/termtable.c \
 -      lib/thread.c \
 +      lib/event.c \
        lib/typerb.c \
        lib/typesafe.c \
        lib/vector.c \
@@@ -147,23 -147,6 +148,23 @@@ nodist_lib_libfrr_la_SOURCES = 
        yang/frr-module-translator.yang.c \
        # end
  
 +# Add logic to build mgmt.proto
 +lib_libfrr_la_LIBADD += $(PROTOBUF_C_LIBS)
 +
 +BUILT_SOURCES += \
 +      lib/mgmt.pb-c.c \
 +      lib/mgmt.pb-c.h \
 +      # end
 +
 +CLEANFILES += \
 +      lib/mgmt.pb-c.h \
 +      lib/mgmt.pb-c.c \
 +      # end
 +
 +lib_libfrr_la_SOURCES += \
 +      lib/mgmt.pb-c.c \
 +      #end
 +
  if SQLITE3
  lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
  lib_libfrr_la_SOURCES += lib/db.c
@@@ -179,7 -162,7 +180,7 @@@ clippy_scan += 
        lib/plist.c \
        lib/routemap.c \
        lib/routemap_cli.c \
 -      lib/thread.c \
 +      lib/event.c \
        lib/vty.c \
        lib/zlog_5424_cli.c \
        # end
@@@ -215,6 -198,7 +216,6 @@@ pkginclude_HEADERS += 
        lib/frratomic.h \
        lib/frrcu.h \
        lib/frrstr.h \
 -      lib/getopt.h \
        lib/graph.h \
        lib/hash.h \
        lib/hook.h \
        lib/if_rmap.h \
        lib/imsg.h \
        lib/ipaddr.h \
+       lib/iso.h \
        lib/jhash.h \
        lib/json.h \
        lib/keychain.h \
        lib/log_vty.h \
        lib/md5.h \
        lib/memory.h \
 +      lib/mgmt.pb-c.h \
 +      lib/mgmt_be_client.h \
 +      lib/mgmt_fe_client.h \
 +      lib/mgmt_msg.h \
 +      lib/mgmt_pb.h \
        lib/module.h \
        lib/monotime.h \
        lib/mpls.h \
        lib/systemd.h \
        lib/table.h \
        lib/termtable.h \
 -      lib/thread.h \
 +      lib/frrevent.h \
        lib/trace.h \
        lib/typerb.h \
        lib/typesafe.h \