vcpe/srcs/libs/include/network/vlan.h

46 lines
689 B
C
Raw Normal View History

2023-03-20 02:47:22 +00:00
//
// Created by xajhuang on 2023/3/18.
//
#ifndef VCPE_VLAN_H
#define VCPE_VLAN_H
#ifdef __cplusplus
extern "C" {
#endif
#include <netinet/ip.h>
#include <netinet/udp.h>
#include <linux/if_ether.h>
#include "common.h"
#pragma pack(push)
#pragma pack(1)
#define VXLAN_VIN_ID_PACK(x) ((ntohs(x)) & 0xFFF)
typedef enum {
VLAN_NONE,
VLAN_LEVEL1,
VLAN_LEVEL2
} VLAN_TYPE;
2023-03-20 02:47:22 +00:00
typedef struct vlan_hdr {
U16 id;
U16 type;
} VLAN_HDR, *PVLAN_HDR;
typedef struct vlan_hdr2 {
U16 id1;
U16 h_type;
U16 id2;
U16 type;
} VLAN_HDR2, *PVLAN_HDR2;
VLAN_TYPE get_package_vlan_type(void *pBuf);
2023-03-20 02:47:22 +00:00
#pragma pack(pop)
#ifdef __cplusplus
}
#endif
#endif //VCPE_VLAN_H