summaryrefslogtreecommitdiff
path: root/ldpd/ldpe.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2020-09-11 15:55:04 -0300
committerGitHub <noreply@github.com>2020-09-11 15:55:04 -0300
commitbeb91114ec5fcfa2bca1c7c1358b39c6640aec4c (patch)
tree2ded0df0de56d9e251e1b1abf6e81d364e35570a /ldpd/ldpe.c
parenta77bd0f4e6b7d63e6f66288d7ea715ae8c55feee (diff)
parent1cbf96a8adf020ce6107ce26fb065d44373e14ce (diff)
Merge pull request #6789 from volta-networks/feat_ldp_igp_sync
ldpd: Add support for LDP-IGP Synchronization
Diffstat (limited to 'ldpd/ldpe.c')
-rw-r--r--ldpd/ldpe.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/ldpd/ldpe.c b/ldpd/ldpe.c
index 9078e711fb..d3374a62db 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);
@@ -975,6 +985,20 @@ ldpe_nbr_ctl(struct ctl_conn *c)
}
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)
{
struct mapping_entry *me;