Add packet IO module
* support marsio
* support dumpfile ( 1 thread read dumpfile & N thread handle packet)
This commit is contained in:
@@ -14,7 +14,7 @@ extern "C"
|
||||
#define PACKET_MAX_LAYERS 16
|
||||
#define PACKET_LOG_ERROR(format, ...) LOG_ERROR("packet", format, ##__VA_ARGS__)
|
||||
#define PACKET_LOG_DEBUG(format, ...) void(0)
|
||||
//#define PACKET_LOG_DEBUG(format, ...) LOG_DEBUG("packet", format, ##__VA_ARGS__)
|
||||
// #define PACKET_LOG_DEBUG(format, ...) LOG_DEBUG("packet", format, ##__VA_ARGS__)
|
||||
|
||||
enum layer_type
|
||||
{
|
||||
@@ -71,6 +71,9 @@ struct layer_record
|
||||
uint16_t pld_len; // payload length
|
||||
};
|
||||
|
||||
#define MAX_SID_NUM 8
|
||||
#define MAX_ROUTE_LEN 64
|
||||
|
||||
struct packet
|
||||
{
|
||||
struct layer_record layers[PACKET_MAX_LAYERS];
|
||||
@@ -81,8 +84,21 @@ struct packet
|
||||
const char *data_ptr;
|
||||
uint16_t data_len;
|
||||
uint64_t domain;
|
||||
bool need_free;
|
||||
|
||||
const void *user_data;
|
||||
// metadata
|
||||
void *io_ctx;
|
||||
|
||||
uint16_t sid_list[MAX_SID_NUM];
|
||||
uint16_t sid_used;
|
||||
|
||||
char route_ctx[MAX_ROUTE_LEN];
|
||||
uint16_t route_len;
|
||||
|
||||
uint64_t session_id;
|
||||
uint8_t direction;
|
||||
uint8_t type;
|
||||
uint8_t action;
|
||||
};
|
||||
|
||||
// return innermost payload
|
||||
|
||||
Reference in New Issue
Block a user