summaryrefslogtreecommitdiff
path: root/print-otv.c
diff options
context:
space:
mode:
authorDenis Ovsienko <infrastation@yandex.ru>2014-03-08 15:28:13 +0400
committerDenis Ovsienko <infrastation@yandex.ru>2014-03-08 16:30:30 +0400
commit0b08cf5378648279efb96ecf03ea2e3f75bc4eff (patch)
tree246bfb0878f4b8ba49dd1403188a2a1f49296dc4 /print-otv.c
parent374aad6c0ea6d12ac4316ead82bb78fc3ff5e05d (diff)
downloadtcpdump-0b08cf5378648279efb96ecf03ea2e3f75bc4eff.tar.gz
NDOize AHCP, OTV and VXLAN decoders
Diffstat (limited to 'print-otv.c')
-rw-r--r--print-otv.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/print-otv.c b/print-otv.c
index fd5a3c7d..3b182f7e 100644
--- a/print-otv.c
+++ b/print-otv.c
@@ -19,10 +19,7 @@
#include <tcpdump-stdinc.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "interface.h"
+#include "netdissect.h"
#include "extract.h"
/*
@@ -38,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;
if (len < 8) {
- printf("[|OTV]");
+ ND_PRINT((ndo, "[|OTV]"));
return;
}
@@ -58,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);
}