diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-07-22 08:01:43 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-12-21 20:26:02 -0500 | 
| commit | 99064df9e385acc466ea8b4ee9f53709d0df9b55 (patch) | |
| tree | 42c6c8d33a467819346b76752c2b87814753478f /pimd/pim_str.c | |
| parent | e945ee80d35e4cce29ec87c1717db0597f8e6af4 (diff) | |
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_str.c')
| -rw-r--r-- | pimd/pim_str.c | 13 | 
1 files changed, 13 insertions, 0 deletions
diff --git a/pimd/pim_str.c b/pimd/pim_str.c index ee9c74fa36..2d647876f6 100644 --- a/pimd/pim_str.c +++ b/pimd/pim_str.c @@ -43,3 +43,16 @@ void pim_inet4_dump(const char *onfail, struct in_addr addr, char *buf, int buf_    errno = save_errno;  } + +char * +pim_str_sg_dump (const struct prefix *sg) +{ +  char src_str[100]; +  char grp_str[100]; +  static char sg_str[200]; + +  pim_inet4_dump ("<src?>", sg->u.sg.src, src_str, sizeof(src_str)); +  pim_inet4_dump ("<grp?>", sg->u.sg.grp, grp_str, sizeof(grp_str)); +  snprintf (sg_str, 200, "(%s,%s)", src_str, grp_str); +  return sg_str; +}  | 
