FreeBSD/contrib/tcpdump/print-vxlan.c
/*
 * VXLAN header, RFC7348
 *               Virtual eXtensible Local Area Network (VXLAN): A Framework
 *               for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks
 *
 *     0                   1                   2                   3
 *     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *    |R|R|R|R|I|R|R|R|            Reserved                           |
 *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *    |                VXLAN Network Identifier (VNI) |   Reserved    |
 *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 */
VXLAN header, RFC7348
Virtual eXtensible Local Area Network (VXLAN): A Framework
for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks


VXLAN header RFC7348 Virtual eXtensible Local Area Network ( VXLAN ) : A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks
void
vxlan_print(netdissect_options *ndo, const u_char *bp, u_int len)
{
    uint8_t flags;
    uint32_t vni;
    if (len < 8) {
        ND_PRINT((ndo, "[|VXLAN]"));
        return;
    }
    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 - 8, len - 8, NULL, NULL);
}
void vxlan_print ( netdissect_options * ndo , const u_char * bp , u_int len ) { uint8_t flags ; uint32_t vni ; if ( len < 8 ) { ND_PRINT ( ( ndo , " " ) ) ; return ; } flags = * bp ; bp += 4 ; vni = EXTRACT_24BITS ( bp ) ; bp += 4 ; ND_PRINT ( ( ndo , " " ) ) ; ND_PRINT ( ( ndo , " " , flags & 0x08 ? " " : " " , flags ) ) ; ND_PRINT ( ( ndo , " \n " , vni ) ) ; ether_print ( ndo , bp , len - 8 , len - 8 , NULL , NULL ) ; }
VXLAN header, RFC7348
               Virtual eXtensible Local Area Network (VXLAN): A Framework
               for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks
VXLAN header RFC7348 Virtual eXtensible Local Area Network ( VXLAN ) : A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks