zclient_sync_init(u_short instance)
{
/* Initialize special zclient for synchronous message exchanges. */
- log_debug("Initializing synchronous zclient for label manager");
zclient_sync = zclient_new(master);
zclient_sync->sock = -1;
zclient_sync->redist_default = ZEBRA_ROUTE_LDP;
int ret;
uint32_t start, end;
- log_debug("Getting label chunk");
+ debug_labels("getting label chunk (size %u)", CHUNK_SIZE);
ret = lm_get_label_chunk(zclient_sync, 0, CHUNK_SIZE, &start, &end);
if (ret < 0) {
log_warnx("Error getting label chunk!");
{
struct label_chunk *new_label_chunk;
- log_debug("Label Chunk assign: %u - %u", start, end);
+ debug_labels("label chunk assign: %u - %u", start, end);
new_label_chunk = calloc(1, sizeof(struct label_chunk));
if (!new_label_chunk) {
DEBUG_OFF(event, EVENT);
else
DEBUG_ON(event, EVENT);
+ } else if (strcmp(type_str, "labels") == 0) {
+ if (negate)
+ DEBUG_OFF(labels, LABELS);
+ else
+ DEBUG_ON(labels, LABELS);
} else if (strcmp(type_str, "messages") == 0) {
if (dir_str == NULL)
return (CMD_WARNING_CONFIG_FAILED);
vty_out (vty, " LDP errors debugging is on\n");
if (LDP_DEBUG(event, EVENT))
vty_out (vty, " LDP events debugging is on\n");
+ if (LDP_DEBUG(labels, LABELS))
+ vty_out (vty, " LDP labels debugging is on\n");
if (LDP_DEBUG(msg, MSG_RECV_ALL))
vty_out (vty,
" LDP detailed messages debugging is on (inbound)\n");
write = 1;
}
+ if (CONF_LDP_DEBUG(labels, LABELS)) {
+ vty_out (vty, "debug mpls ldp labels\n");
+ write = 1;
+ }
+
if (CONF_LDP_DEBUG(msg, MSG_RECV_ALL)) {
vty_out (vty, "debug mpls ldp messages recv all\n");
write = 1;
int event;
#define LDP_DEBUG_EVENT 0x01
+ int labels;
+#define LDP_DEBUG_LABELS 0x01
+
int msg;
#define LDP_DEBUG_MSG_RECV 0x01
#define LDP_DEBUG_MSG_RECV_ALL 0x02
log_debug("event: " emsg, __VA_ARGS__); \
} while (0)
+#define debug_labels(emsg, ...) \
+do { \
+ if (LDP_DEBUG(labels, LABELS)) \
+ log_debug("labels: " emsg, __VA_ARGS__); \
+} while (0)
+
#define debug_msg_recv(emsg, ...) \
do { \
if (LDP_DEBUG(msg, MSG_RECV)) \
DEFPY (ldp_debug_mpls_ldp_type,
ldp_debug_mpls_ldp_type_cmd,
- "[no] debug mpls ldp <errors|event|zebra>$type",
+ "[no] debug mpls ldp <errors|event|labels|zebra>$type",
NO_STR
"Debugging functions\n"
"MPLS information\n"
"Label Distribution Protocol\n"
"Errors\n"
"LDP event information\n"
+ "LDP label allocation information\n"
"LDP zebra information\n")
{
return (ldp_vty_debug(vty, no, type, NULL, NULL));
if (main_imsg_send_ipc_sockets(&iev_ldpe->ibuf, &iev_lde->ibuf))
fatal("could not establish imsg links");
- main_imsg_compose_both(IMSG_INIT, &init, sizeof(init));
main_imsg_compose_both(IMSG_DEBUG_UPDATE, &ldp_debug,
sizeof(ldp_debug));
+ main_imsg_compose_both(IMSG_INIT, &init, sizeof(init));
main_imsg_send_config(ldpd_conf);
if (ldpd_conf->ipv4.flags & F_LDPD_AF_ENABLED)