summaryrefslogtreecommitdiff
path: root/src/HTTP_Analyze.h
blob: 352952a6d11395c587682401cd88272c33d1c37c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef HTTP_ANALYZE_H_
#define HTTP_ANALYZE_H_

#include "HTTP_Message.h"

#define MAX_UNCOMPLETE_COUNT 		256

typedef struct http_stream
{
	uint32 				create_infor_num;	//data for tcp create stream, not for syn
	int 				http_session_num;
	
	http_parser_t* 		first_link_node;		//��Ҫ���ڴ�����ʽ����/��Ӧ�Ե���Ӧ��Ϣ
	http_parser_t*		last_link_node;		//��Ҫ���ڴ�����ʽ����/��Ӧ�Ե�������Ϣ

	uint32 				uncomplete_count;	//��¼��ǰ��Ҫ����������/��Ӧ������
	uint32 				packet_offset;		//�Ѵ��������ڵ�ǰ����ƫ����,��������һ������Ҫ����

	char*				pbuf;				//��һ�������������
	uint32				buflen;
	uint32				reset_count;
#if HTTP_PROXY
	struct streaminfo* p_stream_proxy;
	uchar 				is_proxy;			//callback set_proxy_fstream	
#endif
	uchar 				maybe_http_stream;
	uchar 				res_req;				//���账��������������Ӧ
	uchar 				dir;					//��˫����
	uchar 				is_http_falgs;	
	uchar 				proc_pkt_continue;	
}http_stream;

/*string map func*/
typedef uchar (*STRING_MAP_FUNC)(http_parser_t* a_http, http_stream* a_http_stream, char* value, uint32 valuelen, struct streaminfo *a_tcp,int thread_seq, void *a_packet);
typedef struct string_map_s
{
	const char* 				string;
	uint32 						stringid;
	STRING_MAP_FUNC 			handler;	
}string_map_t;

#ifdef __cplusplus
extern "C" {
#endif

void http_initHttpStream(http_stream**pme, int thread_seq);
void http_releaseHttpStream(http_stream **a_http_stream,struct streaminfo *a_tcp, int thread_seq, void *a_packet);
void http_resetHttpStream(http_stream **ppa_http_stream,struct streaminfo *a_tcp, int thread_seq, void *a_packet);
void http_callPlugin(http_parser_t* cur_http_node, struct streaminfo *a_tcp, int thread_seq, void *a_packet);
int http_getLinkState(http_parser_t *cur_http_node);
void http_resetHttpLinkNode(http_parser_t *cur_node,struct streaminfo *a_tcp, int thread_seq, void *a_packet);
void http_releaseHttpLinkNode(http_stream *a_http_stream,struct streaminfo *a_tcp, int thread_seq, void *a_packet);
uchar http_analyseHttpConnection(http_stream* a_http_stream,struct streaminfo *a_tcp, int thread_seq, void *a_packet);
void http_updatePktOffset(http_parser_t *a_http, http_stream* a_http_stream, struct streaminfo *a_tcp);

#ifdef __cplusplus
}
#endif

#endif