54 lines
1.3 KiB
C
54 lines
1.3 KiB
C
#ifndef NAT_FORMAT_H_
|
|
#define NAT_FORMAT_H_
|
|
|
|
#include <MESA/stream.h>
|
|
#include <MESA/MESA_handle_logger.h>
|
|
#include <MESA/MESA_prof_load.h>
|
|
|
|
// 全局配置信息
|
|
struct nat_format_global_info {
|
|
u_int32_t magic_num;
|
|
u_int32_t version;
|
|
|
|
u_int32_t batch_size;
|
|
char host_ip[64];
|
|
int32_t host_port;
|
|
char multicast_ip[64];
|
|
int32_t multicast_port;
|
|
|
|
int32_t hw_syslog_port;
|
|
int32_t hw_binary_port;
|
|
int32_t h3_syslog_port;
|
|
int32_t h3_binary_port;
|
|
int32_t dp_syslog_port;
|
|
int32_t dp_binary_port;
|
|
|
|
char log_path[256];
|
|
u_int32_t log_level;
|
|
void *log;
|
|
};
|
|
|
|
// 格式化NAT报文载荷
|
|
struct nat_payload {
|
|
unsigned int magic_num;
|
|
unsigned short version;
|
|
unsigned int fw_log_timestamp;
|
|
unsigned int fw_ip;
|
|
char action;
|
|
unsigned int stream_start_timestamp;
|
|
unsigned int stream_end_timestamp;
|
|
unsigned int src_intra_ip;
|
|
unsigned short src_intra_port;
|
|
unsigned int src_extra_ip;
|
|
unsigned short src_extra_port;
|
|
unsigned int dst_ip;
|
|
unsigned short dst_port;
|
|
char protocol;
|
|
};
|
|
|
|
extern "C" int nat_format_init(void);
|
|
extern "C" void nat_format_destroy(void);
|
|
extern "C" char nat_format_entry(struct streaminfo *a_udp, void **pme, int thread_seq, void *a_packet);
|
|
|
|
#endif // NAT_FORMAT_H_
|