2 Star 6 Fork 3

qazxlf / NetSurveyW

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
httpcaptor.h 1.48 KB
一键复制 编辑 原始数据 按行查看 历史
#pragma once
#include "ace/Task.h"
#include <Windows.h>
#include "ace/Log_Msg.h"
#include "ace/OS.h"
#include "ace/Thread_Mutex.h"
#include <WinSock2.h>
#include <string.h>
#include <stdio.h>
#include "nids.h"
#include "ffcs_logger.h"
#include "msgdefine.h"
#include "my_ringbuffbased_fifo.h"
#include <ace/Log_Msg.h>
#include <ace/OS.h>
#include <ace/Configuration.h>
#include <ace/Configuration_Import_Export.h>
#include <string>
class httpcaptor:public ACE_Task<ACE_MT_SYNCH> //capture tcp data
{
public:
httpcaptor(void);
~httpcaptor(void);
static httpcaptor* get_instance();
static void destroy_instance();
int init();
int load_config(const char * _config_filename);
int svc();
inline int set_cached_ringfifo(my_fifo<tcp_connection_info>* fifo){
if(!fifo){
return -1;
}
_ringfifo=fifo;
return 0;
}
inline int setLogger(Logger* logger){
if(!logger){
return -1;
}
_Log=logger;
return 0;
}
inline Logger* getLogger(){
return _Log;
}
inline void stopsvc(){
}
inline const std::string& get_err_msg()const{
return _errmsg;
}
inline void set_dumpfilepath(const char* path){
_dumpfilepath=path;
}
private:
friend void tcp_callback(struct tcp_stream *tcp_http_connection, void **param);
void put_data_into_fifo(tcp_connection_info& tci);
private:
static ACE_Thread_Mutex _mutex;
static httpcaptor* _instance;
Logger* _Log;
my_fifo<tcp_connection_info>* _ringfifo;
char _device[128];
std::string _errmsg;
std::string _dumpfilepath;
};
C++
1
https://gitee.com/xulongfei0612/NetSurveyW.git
git@gitee.com:xulongfei0612/NetSurveyW.git
xulongfei0612
NetSurveyW
NetSurveyW
master

搜索帮助