TSG-13684 tsg-service-chaining-engine使用VLAN封装Packet并执行Traffic Mirroring
This commit is contained in:
40
common/include/control_packet.h
Normal file
40
common/include/control_packet.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef _CONTROL_PACKET_H
|
||||
#define _CONTROL_PACKET_H
|
||||
|
||||
#ifdef __cpluscplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
enum session_state
|
||||
{
|
||||
SESSION_STATE_OPENING = 1,
|
||||
SESSION_STATE_CLOSING = 2,
|
||||
SESSION_STATE_ACTIVE = 3,
|
||||
SESSION_STATE_RESETALL = 4,
|
||||
};
|
||||
|
||||
struct control_packet
|
||||
{
|
||||
char tsync[4];
|
||||
uint64_t session_id;
|
||||
enum session_state state;
|
||||
char method[32];
|
||||
uint64_t rule_ids[32];
|
||||
int rule_id_num;
|
||||
};
|
||||
|
||||
const char *session_state_to_string(enum session_state state);
|
||||
|
||||
// return 0 : success
|
||||
// return -1 : error
|
||||
int control_packet_parse(struct control_packet *handler, const char *data, size_t length);
|
||||
void control_packet_dump(struct control_packet *handler);
|
||||
|
||||
#ifdef __cpluscplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user