X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/a97fb2f3ae9731dd13e6854742c090ca9ef454cf..0845bc813c1cc48b18cdefff0b387c110647463c:/print-otv.c diff --git a/print-otv.c b/print-otv.c index 25c21f09..7f619df3 100644 --- a/print-otv.c +++ b/print-otv.c @@ -19,14 +19,8 @@ #include -#include -#include - -#include "interface.h" +#include "netdissect.h" #include "extract.h" -#include "addrtoname.h" - -#include "udp.h" /* * OTV header, draft-hasmit-otv-04 @@ -41,14 +35,14 @@ */ void -otv_print(const u_char *bp, u_int len) +otv_print(netdissect_options *ndo, const u_char *bp, u_int len) { - u_int8_t flags; - u_int32_t overlay_id; - u_int32_t instance_id; + uint8_t flags; + uint32_t overlay_id; + uint32_t instance_id; if (len < 8) { - printf("[|OTV]"); + ND_PRINT((ndo, "[|OTV]")); return; } @@ -61,19 +55,10 @@ otv_print(const u_char *bp, u_int len) instance_id = EXTRACT_24BITS(bp); bp += 4; - printf("OTV, "); - - fputs("flags [", stdout); - if (flags & 0x08) - fputs("I", stdout); - else - fputs(".", stdout); - fputs("] ", stdout); - - printf("(0x%02x), ", flags); - printf("overlay %u, ", overlay_id); - printf("instance %u\n", instance_id); + ND_PRINT((ndo, "OTV, ")); + ND_PRINT((ndo, "flags [%s] (0x%02x), ", flags & 0x08 ? "I" : ".", flags)); + ND_PRINT((ndo, "overlay %u, ", overlay_id)); + ND_PRINT((ndo, "instance %u\n", instance_id)); - ether_print(gndo, bp, len - 8, len - 8, NULL, NULL); - return; + ether_print(ndo, bp, len - 8, len - 8, NULL, NULL); }