diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2017-03-18 21:58:51 -0300 | 
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2017-03-20 21:42:14 -0300 | 
| commit | 0f7b5df9259347bfc425c73fe7cf1ffc89cf2269 (patch) | |
| tree | 1d6397c74b240d22d72db8629583f994c2bc47e2 /ldpd/lde_lib.c | |
| parent | f2725627317af322faa926fb9098e0adb9c60ae4 (diff) | |
ldpd: provide more detailed information in some show commands
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ldpd/lde_lib.c')
| -rw-r--r-- | ldpd/lde_lib.c | 29 | 
1 files changed, 18 insertions, 11 deletions
diff --git a/ldpd/lde_lib.c b/ldpd/lde_lib.c index 4444a1e1ac..db2682a173 100644 --- a/ldpd/lde_lib.c +++ b/ldpd/lde_lib.c @@ -162,7 +162,7 @@ rt_dump(pid_t pid)  		    RB_EMPTY(&fn->downstream))  			continue; -		rtctl.first = 1; +		memset(&rtctl, 0, sizeof(rtctl));  		switch (fn->fec.type) {  		case FEC_TYPE_IPV4:  			rtctl.af = AF_INET; @@ -179,23 +179,30 @@ rt_dump(pid_t pid)  		}  		rtctl.local_label = fn->local_label; -		RB_FOREACH(me, lde_map_head, &fn->downstream) { -			rtctl.in_use = lde_nbr_is_nexthop(fn, me->nexthop); -			rtctl.nexthop = me->nexthop->id; -			rtctl.remote_label = me->map.label; - -			lde_imsg_compose_ldpe(IMSG_CTL_SHOW_LIB, 0, pid, -			    &rtctl, sizeof(rtctl)); -			rtctl.first = 0; -		}  		if (RB_EMPTY(&fn->downstream)) {  			rtctl.in_use = 0;  			rtctl.nexthop.s_addr = INADDR_ANY;  			rtctl.remote_label = NO_LABEL; +			rtctl.no_downstream = 1; +		} +		lde_imsg_compose_ldpe(IMSG_CTL_SHOW_LIB_BEGIN, 0, pid, &rtctl, +		    sizeof(rtctl)); -			lde_imsg_compose_ldpe(IMSG_CTL_SHOW_LIB, 0, pid, +		RB_FOREACH(me, lde_map_head, &fn->upstream) { +			rtctl.nexthop = me->nexthop->id; +			lde_imsg_compose_ldpe(IMSG_CTL_SHOW_LIB_SENT, 0, pid, +			    &rtctl, sizeof(rtctl)); +		} + +		RB_FOREACH(me, lde_map_head, &fn->downstream) { +			rtctl.in_use = lde_nbr_is_nexthop(fn, me->nexthop); +			rtctl.nexthop = me->nexthop->id; +			rtctl.remote_label = me->map.label; +			lde_imsg_compose_ldpe(IMSG_CTL_SHOW_LIB_RCVD, 0, pid,  			    &rtctl, sizeof(rtctl));  		} +		lde_imsg_compose_ldpe(IMSG_CTL_SHOW_LIB_END, 0, pid, &rtctl, +		    sizeof(rtctl));  	}  }  | 
