#ifndef DELIVER_PROCESS_H #define DELIVER_PROCESS_H #include #include #ifdef __cplusplus extern "C" { #endif #define DELIVER_DIR_C2S 0x01 #define DELIVER_DIR_S2C 0x02 struct deliver_addr_info { 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 deliver_init(int thread_num,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 deliver_session_start(int thread_seq,struct deliver_addr_info* 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 deliver_session_data(int cur_dir,int thread_seq,int buflen,char*buf,void** pme); /************************************************************************** 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 ***************************************************************************/ int deliver_session_end(int thread_seq,void** pme); #ifdef __cplusplus } #endif #endif