Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /*
0003  * ERSPAN Tunnel Metadata
0004  *
0005  * Copyright (c) 2018 VMware
0006  *
0007  * This program is free software; you can redistribute it and/or modify
0008  * it under the terms of the GNU General Public License version 2
0009  * as published by the Free Software Foundation.
0010  *
0011  * Userspace API for metadata mode ERSPAN tunnel
0012  */
0013 #ifndef _UAPI_ERSPAN_H
0014 #define _UAPI_ERSPAN_H
0015 
0016 #include <linux/types.h>    /* For __beXX in userspace */
0017 #include <asm/byteorder.h>
0018 
0019 /* ERSPAN version 2 metadata header */
0020 struct erspan_md2 {
0021     __be32 timestamp;
0022     __be16 sgt; /* security group tag */
0023 #if defined(__LITTLE_ENDIAN_BITFIELD)
0024     __u8    hwid_upper:2,
0025         ft:5,
0026         p:1;
0027     __u8    o:1,
0028         gra:2,
0029         dir:1,
0030         hwid:4;
0031 #elif defined(__BIG_ENDIAN_BITFIELD)
0032     __u8    p:1,
0033         ft:5,
0034         hwid_upper:2;
0035     __u8    hwid:4,
0036         dir:1,
0037         gra:2,
0038         o:1;
0039 #else
0040 #error "Please fix <asm/byteorder.h>"
0041 #endif
0042 };
0043 
0044 struct erspan_metadata {
0045     int version;
0046     union {
0047         __be32 index;       /* Version 1 (type II)*/
0048         struct erspan_md2 md2;  /* Version 2 (type III) */
0049     } u;
0050 };
0051 
0052 #endif /* _UAPI_ERSPAN_H */