summaryrefslogtreecommitdiffstats
path: root/pimd/pim_macro.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-07-22 14:01:43 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-12-22 02:26:02 +0100
commit99064df9e385acc466ea8b4ee9f53709d0df9b55 (patch)
tree42c6c8d33a467819346b76752c2b87814753478f /pimd/pim_macro.c
parentlib: Setup prefix.h to allow it to store (s,g) (diff)
downloadfrr-99064df9e385acc466ea8b4ee9f53709d0df9b55.tar.xz
frr-99064df9e385acc466ea8b4ee9f53709d0df9b55.zip
pimd: Convert ifchannel to using a prefix to store (s,g)
Convert ifchannel to use a prefix to store (s,g) information. Additionally create pim_str_sg_dump function to output data when using debugs. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_macro.c')
-rw-r--r--pimd/pim_macro.c48
1 files changed, 12 insertions, 36 deletions
diff --git a/pimd/pim_macro.c b/pimd/pim_macro.c
index 39098df52..ea9fc3b06 100644
--- a/pimd/pim_macro.c
+++ b/pimd/pim_macro.c
@@ -102,13 +102,9 @@ int pim_macro_ch_lost_assert(const struct pim_ifchannel *ch)
ifp = ch->interface;
if (!ifp) {
- char src_str[100];
- char grp_str[100];
- pim_inet4_dump("<src?>", ch->source_addr, src_str, sizeof(src_str));
- pim_inet4_dump("<grp?>", ch->group_addr, grp_str, sizeof(grp_str));
- zlog_warn("%s: (S,G)=(%s,%s): null interface",
+ zlog_warn("%s: (S,G)=%s: null interface",
__PRETTY_FUNCTION__,
- src_str, grp_str);
+ pim_str_sg_dump (&ch->sg));
return 0; /* false */
}
@@ -118,13 +114,9 @@ int pim_macro_ch_lost_assert(const struct pim_ifchannel *ch)
pim_ifp = ifp->info;
if (!pim_ifp) {
- char src_str[100];
- char grp_str[100];
- pim_inet4_dump("<src?>", ch->source_addr, src_str, sizeof(src_str));
- pim_inet4_dump("<grp?>", ch->group_addr, grp_str, sizeof(grp_str));
- zlog_warn("%s: (S,G)=(%s,%s): multicast not enabled on interface %s",
+ zlog_warn("%s: (S,G)=%s: multicast not enabled on interface %s",
__PRETTY_FUNCTION__,
- src_str, grp_str, ifp->name);
+ pim_str_sg_dump (&ch->sg), ifp->name);
return 0; /* false */
}
@@ -159,13 +151,9 @@ int pim_macro_chisin_pim_include(const struct pim_ifchannel *ch)
struct pim_interface *pim_ifp = ch->interface->info;
if (!pim_ifp) {
- char src_str[100];
- char grp_str[100];
- pim_inet4_dump("<src?>", ch->source_addr, src_str, sizeof(src_str));
- pim_inet4_dump("<grp?>", ch->group_addr, grp_str, sizeof(grp_str));
- zlog_warn("%s: (S,G)=(%s,%s): multicast not enabled on interface %s",
+ zlog_warn("%s: (S,G)=%s: multicast not enabled on interface %s",
__PRETTY_FUNCTION__,
- src_str, grp_str, ch->interface->name);
+ pim_str_sg_dump (&ch->sg), ch->interface->name);
return 0; /* false */
}
@@ -227,13 +215,9 @@ int pim_macro_ch_could_assert_eval(const struct pim_ifchannel *ch)
ifp = ch->interface;
if (!ifp) {
- char src_str[100];
- char grp_str[100];
- pim_inet4_dump("<src?>", ch->source_addr, src_str, sizeof(src_str));
- pim_inet4_dump("<grp?>", ch->group_addr, grp_str, sizeof(grp_str));
- zlog_warn("%s: (S,G)=(%s,%s): null interface",
+ zlog_warn("%s: (S,G)=%s: null interface",
__PRETTY_FUNCTION__,
- src_str, grp_str);
+ pim_str_sg_dump (&ch->sg));
return 0; /* false */
}
@@ -388,25 +372,17 @@ int pim_macro_assert_tracking_desired_eval(const struct pim_ifchannel *ch)
ifp = ch->interface;
if (!ifp) {
- char src_str[100];
- char grp_str[100];
- pim_inet4_dump("<src?>", ch->source_addr, src_str, sizeof(src_str));
- pim_inet4_dump("<grp?>", ch->group_addr, grp_str, sizeof(grp_str));
- zlog_warn("%s: (S,G)=(%s,%s): null interface",
+ zlog_warn("%s: (S,G)=%s: null interface",
__PRETTY_FUNCTION__,
- src_str, grp_str);
+ pim_str_sg_dump (&ch->sg));
return 0; /* false */
}
pim_ifp = ifp->info;
if (!pim_ifp) {
- char src_str[100];
- char grp_str[100];
- pim_inet4_dump("<src?>", ch->source_addr, src_str, sizeof(src_str));
- pim_inet4_dump("<grp?>", ch->group_addr, grp_str, sizeof(grp_str));
- zlog_warn("%s: (S,G)=(%s,%s): multicast not enabled on interface %s",
+ zlog_warn("%s: (S,G)=%s: multicast not enabled on interface %s",
__PRETTY_FUNCTION__,
- src_str, grp_str, ch->interface->name);
+ pim_str_sg_dump (&ch->sg), ch->interface->name);
return 0; /* false */
}