TSG-13630 tsg-service-chaining-engine使用mrzcpd捕获报文/回注报文
TSG-13685 tsg-service-chaining-engine使用VXLAN封装Steering/Mirroring的Package
This commit is contained in:
52
common/include/g_vxlan.h
Normal file
52
common/include/g_vxlan.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#ifndef _G_VXLAN_H
|
||||
#define _G_VXLAN_H
|
||||
|
||||
#ifdef __cpluscplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct g_vxlan
|
||||
{
|
||||
unsigned char flags;
|
||||
unsigned char reserved[3];
|
||||
|
||||
// VNI 3 Bytes
|
||||
unsigned char vlan_id_half_high;
|
||||
|
||||
unsigned char link_layer_type : 4; // 二层报文封装格式
|
||||
unsigned char vlan_id_half_low : 4;
|
||||
|
||||
unsigned int dir_is_e2i : 1;
|
||||
unsigned int traffic_is_decrypted : 1;
|
||||
unsigned int chain_index : 5; // max value 32
|
||||
unsigned int online_test : 1;
|
||||
|
||||
// Reserved 1 Bytes
|
||||
unsigned int r7 : 1;
|
||||
unsigned int r6 : 1;
|
||||
unsigned int r5 : 1;
|
||||
unsigned int r4 : 1;
|
||||
unsigned int vni_flag : 1;
|
||||
unsigned int r2 : 1;
|
||||
unsigned int r1 : 1;
|
||||
unsigned int r0 : 1;
|
||||
} __attribute__((__packed__));
|
||||
|
||||
void g_vxlan_set_packet_dir(struct g_vxlan *hdr, int dir_is_e2i);
|
||||
void g_vxlan_set_chain_index(struct g_vxlan *hdr, int chain_index);
|
||||
void g_vxlan_set_traffic_type(struct g_vxlan *hdr, int traffic_is_decrypted);
|
||||
|
||||
int g_vxlan_get_packet_dir(struct g_vxlan *hdr);
|
||||
int g_vxlan_get_chain_index(struct g_vxlan *hdr);
|
||||
int g_vxlan_get_traffic_type(struct g_vxlan *hdr);
|
||||
|
||||
// return 0 : success
|
||||
// return -1 : error
|
||||
int g_vxlan_decode(struct g_vxlan **g_vxlan_hd, const char *raw_data, int raw_len);
|
||||
|
||||
#ifdef __cpluscplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user