summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Grajciar <jgrajcia@cisco.com>2018-04-16 10:39:24 +0200
committerJakub Grajciar <jgrajcia@cisco.com>2018-04-17 07:58:14 +0000
commit83dbe57e5d32f516f297a99216c51676775bf861 (patch)
tree508b78017dce16799cd520802c417b40650c7550
parente9be71534be452a34028ed85475a2975e03b6215 (diff)
igmp: fix debug macro
Change-Id: I071d4cfcf6ea9763dd4842a3594c486a8e400e8c Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
-rw-r--r--src/plugins/igmp/igmp.c2
-rw-r--r--src/plugins/igmp/igmp.h10
-rw-r--r--src/plugins/igmp/input.c14
3 files changed, 13 insertions, 13 deletions
diff --git a/src/plugins/igmp/igmp.c b/src/plugins/igmp/igmp.c
index e98e976cc96..55a5d0e0a87 100644
--- a/src/plugins/igmp/igmp.c
+++ b/src/plugins/igmp/igmp.c
@@ -567,7 +567,7 @@ igmp_timer_process (vlib_main_t * vm, vlib_node_runtime_t * rt,
if (event_type == IGMP_PROCESS_EVENT_UPDATE_TIMER)
goto next_timer;
- DBG ("time: %f", vlib_time_now (vm));
+ IGMP_DBG ("time: %f", vlib_time_now (vm));
/* timer expired */
if (NULL != timer)
diff --git a/src/plugins/igmp/igmp.h b/src/plugins/igmp/igmp.h
index 0dcf11f64f7..f5fb958fcad 100644
--- a/src/plugins/igmp/igmp.h
+++ b/src/plugins/igmp/igmp.h
@@ -28,13 +28,13 @@
#define IGMP_SG_TIMER (3 * IGMP_QUERY_TIMER)
#define IGMP_DEFAULT_ROBUSTNESS_VARIABLE (2)
-#define IGMP_DBG 1
+#define ENABLE_IGMP_DBG 0
-#if IGMP_DBG
-#define DBG(...) clib_warning(__VA_ARGS__)
+#if ENABLE_IGMP_DBG == 1
+#define IGMP_DBG(...) clib_warning(__VA_ARGS__)
#else
-#define DBG(...)
-#endif /* IGMP_DBG */
+#define IGMP_DBG(...)
+#endif /* ENABLE_IGMP_DBG */
#define group_ptr(p, l) ((igmp_membership_group_v3_t *)((char*)p + l))
diff --git a/src/plugins/igmp/input.c b/src/plugins/igmp/input.c
index 9e46e600950..ec0ae36c5a6 100644
--- a/src/plugins/igmp/input.c
+++ b/src/plugins/igmp/input.c
@@ -118,7 +118,7 @@ uword
igmp_input (vlib_main_t * vm, vlib_node_runtime_t * node,
vlib_frame_t * frame)
{
- DBG ("IGMP_INPUT");
+ IGMP_DBG ("IGMP_INPUT");
u32 n_left_from, *from, *to_next;
igmp_parse_query_next_t next_index;
vlib_node_runtime_t *error_node =
@@ -243,7 +243,7 @@ uword
igmp_parse_query (vlib_main_t * vm, vlib_node_runtime_t * node,
vlib_frame_t * frame)
{
- DBG ("IGMP_PARSE_QUERY");
+ IGMP_DBG ("IGMP_PARSE_QUERY");
u32 n_left_from, *from, *to_next;
igmp_parse_query_next_t next_index;
@@ -285,7 +285,7 @@ igmp_parse_query (vlib_main_t * vm, vlib_node_runtime_t * node,
config = igmp_config_lookup (im, sw_if_index);
if (!config)
{
- DBG ("No config on interface %u", sw_if_index);
+ IGMP_DBG ("No config on interface %u", sw_if_index);
}
else
{
@@ -348,7 +348,7 @@ uword
igmp_parse_report (vlib_main_t * vm, vlib_node_runtime_t * node,
vlib_frame_t * frame)
{
- DBG ("IGMP_PARSE_REPORT");
+ IGMP_DBG ("IGMP_PARSE_REPORT");
igmp_main_t *im = &igmp_main;
u32 n_left_from, *from, *to_next;
@@ -409,14 +409,14 @@ igmp_parse_report (vlib_main_t * vm, vlib_node_runtime_t * node,
config->flags |= IGMP_CONFIG_FLAG_QUERY_RESP_RECVED;
if (config->cli_api_configured)
{
- DBG ("Interface %u has (S,G)s configured by CLI/API",
- sw_if_index);
+ IGMP_DBG ("Interface %u has (S,G)s configured by CLI/API",
+ sw_if_index);
error = IGMP_ERROR_CLI_API_CONFIG;
b->error = error_node->errors[error];
goto next_frame;
}
}
- DBG ("interface %u", sw_if_index);
+ IGMP_DBG ("interface %u", sw_if_index);
int i, j = 0;
for (i = 0; i < clib_net_to_host_u16 (igmp->n_groups); i++)
{