mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-05 22:23:12 +00:00
pimd: Make pim_pkt_dump use standard lib functions
pim_pkt_dump was creating a custom function to dump detailed packet data. Switch it over to use zlog_hexdump. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
934a4c5975
commit
95ff066772
@ -100,23 +100,8 @@ uint16_t igmp_msg_decode8to16(uint8_t code)
|
|||||||
|
|
||||||
void pim_pkt_dump(const char *label, const uint8_t *buf, int size)
|
void pim_pkt_dump(const char *label, const uint8_t *buf, int size)
|
||||||
{
|
{
|
||||||
char dump_buf[1000];
|
zlog_debug("%s: pkt dump size=%d",
|
||||||
int i = 0;
|
|
||||||
int j = 0;
|
|
||||||
|
|
||||||
for (; i < size; ++i, j += 2) {
|
|
||||||
int left = sizeof(dump_buf) - j;
|
|
||||||
if (left < 4) {
|
|
||||||
if (left > 1) {
|
|
||||||
strcat(dump_buf + j, "!"); /* mark as truncated */
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
snprintf(dump_buf + j, left, "%02x", buf[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
zlog_debug("%s: pkt dump size=%d: %s",
|
|
||||||
label,
|
label,
|
||||||
size,
|
size);
|
||||||
dump_buf);
|
zlog_hexdump(buf, size);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user