修改decrypt-mirror插件的文件名和目录结构。增加平台胶合层decrypt_mirror_plugin.h和decrypt_mirror_plugin.cpp
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
#ifndef DELIVER_PROCESS_H
|
||||
#define DELIVER_PROCESS_H
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <tfe_stream.h>
|
||||
|
||||
|
||||
#define DELIVER_DIR_C2S 0x01
|
||||
#define DELIVER_DIR_S2C 0x02
|
||||
|
||||
|
||||
struct origin_stream_addr
|
||||
{
|
||||
struct sockaddr* client;
|
||||
struct sockaddr* server;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
Description:deliver read config from filepath to init;
|
||||
Paraments:
|
||||
thread_num:[IN],total process data thread num
|
||||
filepath:[IN], conf file path,read use MESA_prof_load;
|
||||
Return:
|
||||
0:succes
|
||||
<0:error
|
||||
***************************************************************************/
|
||||
int mirror_stream_init(int thread_num, const char* filepath);
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
Description:call this function before send a new session data
|
||||
Paraments:
|
||||
thread_seq:[IN], thread seq
|
||||
addr:[IN],addr of the session to be send
|
||||
pme:[OUT],buffer alive in the session,deliver malloc and free *pme;
|
||||
Return:
|
||||
0:succes
|
||||
<0:error
|
||||
***************************************************************************/
|
||||
int mirror_stream_open(struct origin_stream_addr* addr,void** pme);
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
Description:call this function when send session data
|
||||
Paraments:
|
||||
cur_dir:[IN], direction of current data,definition in DELIVER_DIR_***
|
||||
thread_seq:[IN],thread seq
|
||||
buflen:[IN],buffer len,tcp payload len;
|
||||
buf:[IN],data fo the session to be send,tcp payload
|
||||
pme:[OUT]
|
||||
Return:
|
||||
0:succes
|
||||
<0:error
|
||||
***************************************************************************/
|
||||
int mirror_stream_write(enum tfe_conn_dir cur_dir,const unsigned char * data, size_t len, void** pme,int thread_seq);
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
Description:call this function after send all of session data
|
||||
Paraments:
|
||||
thread_seq:[IN], thread seq
|
||||
pme:[OUT]; free *pme when deliver_end()
|
||||
Return:
|
||||
0:succes
|
||||
<0:error
|
||||
***************************************************************************/
|
||||
void mirror_stream_close(void** pme, int thread_id);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef DELIVER_PRIVATE_H
|
||||
#define DELIVER_PRIVATE_H
|
||||
|
||||
#include <decrypt-mirroring.h>
|
||||
#include <mirror_stream.h>
|
||||
#include <MESA/field_stat2.h>
|
||||
|
||||
#ifndef MAX_THREAD_NUM
|
||||
@@ -12,8 +12,8 @@
|
||||
#define DELIVER_SENDPKT_BUFLEN 2048
|
||||
|
||||
//runtime log
|
||||
#define DELIVER_MODULE_INIT "deliver_init"
|
||||
#define DELIVER_MODULE_SENDPKT "deliver_sendpkt"
|
||||
#define DELIVER_MODULE_INIT "mirror_stream_init"
|
||||
#define DELIVER_MODULE_SENDPKT "mirror_stream_sendpkt"
|
||||
#define DELIVER_SENDPKT_START "sendpkt_start"
|
||||
#define DELIVER_SENDPKT_DEBUG "sendpkt_debug"
|
||||
#define DELIVER_RECVPKT_DEBUG "recvpkt_debug"
|
||||
@@ -76,7 +76,7 @@ struct deliver_comm_info
|
||||
|
||||
struct deliver_pkt_info
|
||||
{
|
||||
int dir;
|
||||
enum tfe_conn_dir dir;
|
||||
unsigned int seq; //host order
|
||||
unsigned int ack; //host order
|
||||
unsigned int len; //host order,tcp payload len
|
||||
@@ -99,7 +99,7 @@ struct deliver_session_info
|
||||
struct deliver_pme_info
|
||||
{
|
||||
unsigned char dst_macaddr[DELIVER_MACADDR_LEN];
|
||||
struct deliver_addr_info addr_info;
|
||||
struct origin_stream_addr addr_info;
|
||||
struct deliver_pkt_info pkt_info;
|
||||
struct deliver_session_info session_info;
|
||||
};
|
||||
Reference in New Issue
Block a user