mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 13:33:15 +00:00
pimd: Add pim_addr_dump to facilitate v4 and v6 address dumping
Allow pim_addr_dump to understand prefixes to print out. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
84a35fdf06
commit
e66dd14ae4
@ -29,6 +29,20 @@
|
|||||||
|
|
||||||
#include "pim_str.h"
|
#include "pim_str.h"
|
||||||
|
|
||||||
|
void pim_addr_dump (const char *onfail, struct prefix *p, char *buf, int buf_size)
|
||||||
|
{
|
||||||
|
int save_errno = errno;
|
||||||
|
|
||||||
|
if (!inet_ntop(p->family, &p->u.prefix, buf, buf_size)) {
|
||||||
|
zlog_warn("pim_addr_dump: inet_ntop(buf_size=%d): errno=%d: %s",
|
||||||
|
buf_size, errno, safe_strerror(errno));
|
||||||
|
if (onfail)
|
||||||
|
snprintf(buf, buf_size, "%s", onfail);
|
||||||
|
}
|
||||||
|
|
||||||
|
errno = save_errno;
|
||||||
|
}
|
||||||
|
|
||||||
void pim_inet4_dump(const char *onfail, struct in_addr addr, char *buf, int buf_size)
|
void pim_inet4_dump(const char *onfail, struct in_addr addr, char *buf, int buf_size)
|
||||||
{
|
{
|
||||||
int save_errno = errno;
|
int save_errno = errno;
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
|
|
||||||
|
void pim_addr_dump (const char *onfail, struct prefix *p, char *buf, int buf_size);
|
||||||
void pim_inet4_dump(const char *onfail, struct in_addr addr, char *buf, int buf_size);
|
void pim_inet4_dump(const char *onfail, struct in_addr addr, char *buf, int buf_size);
|
||||||
char *pim_str_sg_dump (const struct prefix_sg *sg);
|
char *pim_str_sg_dump (const struct prefix_sg *sg);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user