1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- #ifdef HAVE_CONFIG_H
- #include "config.h"
- #endif
- #include <netdissect-stdinc.h>
- #include "netdissect.h"
- #include "extract.h"
- static const char tstr[] = " [|VXLAN]";
- #define VXLAN_HDR_LEN 8
- void
- vxlan_print(netdissect_options *ndo, const u_char *bp, u_int len)
- {
- uint8_t flags;
- uint32_t vni;
- if (len < VXLAN_HDR_LEN)
- goto trunc;
- ND_TCHECK2(*bp, VXLAN_HDR_LEN);
- flags = *bp;
- bp += 4;
- vni = EXTRACT_24BITS(bp);
- bp += 4;
- ND_PRINT((ndo, "VXLAN, "));
- ND_PRINT((ndo, "flags [%s] (0x%02x), ", flags & 0x08 ? "I" : ".", flags));
- ND_PRINT((ndo, "vni %u\n", vni));
- ether_print(ndo, bp, len - VXLAN_HDR_LEN, ndo->ndo_snapend - bp, NULL, NULL);
- return;
- trunc:
- ND_PRINT((ndo, "%s", tstr));
- }
|