From e1894ff70f77f39ae993f875a96d6cb1282ffd1a Mon Sep 17 00:00:00 2001 From: Karen Schoener Date: Wed, 22 Jul 2020 12:10:59 -0400 Subject: ldpd: Adding support for LDP IGP Synchronization Signed-off-by: Lynne Morrison Signed-off-by: Karen Schoener --- ldpd/ldpe.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'ldpd/ldpe.c') diff --git a/ldpd/ldpe.c b/ldpd/ldpe.c index 655313bf16..29a37efb07 100644 --- a/ldpd/ldpe.c +++ b/ldpd/ldpe.c @@ -297,6 +297,7 @@ ldpe_dispatch_main(struct thread *thread) #endif int n, shut = 0; struct ldp_access *laccess; + struct ldp_igp_sync_if_state_req *ldp_sync_if_state_req; iev->ev_read = NULL; @@ -559,6 +560,15 @@ ldpe_dispatch_main(struct thread *thread) ldpe_check_filter_af(AF_INET6, &leconf->ipv6, laccess->name); break; + case IMSG_LDP_SYNC_IF_STATE_REQUEST: + if (imsg.hdr.len != IMSG_HEADER_SIZE + + sizeof(struct ldp_igp_sync_if_state_req)) { + log_warnx("%s: wrong imsg len", __func__); + break; + } + ldp_sync_if_state_req = imsg.data; + ldp_sync_fsm_state_req(ldp_sync_if_state_req); + break; default: log_debug("ldpe_dispatch_main: error handling imsg %d", imsg.hdr.type); @@ -978,6 +988,20 @@ ldpe_nbr_ctl(struct ctl_conn *c) imsg_compose_event(&c->iev, IMSG_CTL_END, 0, 0, -1, NULL, 0); } +void +ldpe_ldp_sync_ctl(struct ctl_conn *c) +{ + struct iface *iface; + struct ctl_ldp_sync *ictl; + + RB_FOREACH(iface, iface_head, &leconf->iface_tree) { + ictl = ldp_sync_to_ctl(iface); + imsg_compose_event(&c->iev, IMSG_CTL_SHOW_LDP_SYNC, + 0, 0, -1, ictl, sizeof(struct ctl_ldp_sync)); + } + imsg_compose_event(&c->iev, IMSG_CTL_END, 0, 0, -1, NULL, 0); +} + void mapping_list_add(struct mapping_head *mh, struct map *map) { -- cgit v1.2.3