From a49fc2eb8e40e80ba7ababadd5a623b103445987 Mon Sep 17 00:00:00 2001 From: "James R. Leu" Date: Tue, 18 Mar 2003 20:26:32 -0600 Subject: [PATCH] Add more logging when creating ADJs and when binding them to a session. [git-p4: depot-paths = "//depot/ldp-portable/": change = 339] --- ldp/ldp_adj.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ldp/ldp_adj.c b/ldp/ldp_adj.c index f9f230b..3b23ffa 100644 --- a/ldp/ldp_adj.c +++ b/ldp/ldp_adj.c @@ -30,6 +30,7 @@ ldp_adj *ldp_adj_create(mpls_inet_addr * source, mpls_inet_addr * lsraddr, mpls_inet_addr * remote_transport_address, uint32_t remote_csn) { ldp_adj *a = (ldp_adj *) mpls_malloc(sizeof(ldp_adj)); + struct in_addr addr; if (lsraddr == NULL || source == NULL) return NULL; @@ -50,6 +51,13 @@ ldp_adj *ldp_adj_create(mpls_inet_addr * source, mpls_inet_addr * lsraddr, memcpy(&a->remote_source_address, source, sizeof(mpls_inet_addr)); memcpy(&a->remote_lsr_address, lsraddr, sizeof(mpls_inet_addr)); + addr.s_addr = htonl(lsraddr->u.ipv4); + LDP_TRACE_LOG(g->user_data, MPLS_TRACE_STATE_ALL, LDP_TRACE_FLAG_PERIODIC, + "Adj(%d) created for %s/",a->index, inet_ntoa(addr)); + addr.s_addr = htonl(source->u.ipv4); + LDP_TRACE_LOG(g->user_data, MPLS_TRACE_STATE_ALL, LDP_TRACE_FLAG_PERIODIC, + "%s\n",inet_ntoa(addr)); + if (remote_transport_address) { memcpy(&a->remote_transport_address, remote_transport_address, sizeof(mpls_inet_addr)); @@ -250,6 +258,9 @@ void ldp_adj_add_session(ldp_adj * a, ldp_session * s) { MPLS_ASSERT(a && s); + LDP_TRACE_LOG(g->user_data, MPLS_TRACE_STATE_ALL, LDP_TRACE_FLAG_PERIODIC, + "Adj(%d) bound to sesssion(%d)\n",a->index,s->index); + MPLS_REFCNT_HOLD(s); a->session = s; _ldp_session_add_adj(s, a); -- 2.11.4.GIT