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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
#ifndef _PLUGIN_H
#define _PLUGIN_H
#include <netinet/ip.h>
#include "stream.h"
#ifndef MAX_THREAD_NUM
#define MAX_THREAD_NUM 128
#endif
#define PLUGTYPE_PROTOCOL 1
#define PLUGTYPE_BUSENISS 2
#define PLUGTYPE_PLATFORM 3
#define PLUGIN_MAX_ENTRYNUM 16
#define PLUGIN_MAX_CONFLEN 1024
#define KEYWORD_SPECIAL1 "["
#define KEYWORD_SPECIAL2 "]"
#define SECTION_PLUGINFO "PLUGINFO"
#define SECTION_FUN_IP "IP"
#define SECTION_FUN_IPV6 "IPV6"
#define SECTION_FUN_IPV4_RAW "IPV4_RAW"
#define SECTION_FUN_IPV6_RAW "IPV6_RAW"
#define SECTION_FUN_TCP "TCP"
#define SECTION_FUN_TCP_ALL "TCP_ALL"
#define SECTION_FUN_UDP "UDP"
#define SECTION_FUN_TCP_RAW "TCP_RAW"
#define SECTION_FUN_TCPALL_RAW "TCPALL_RAW"
#define SECTION_FUN_UDP_RAW "UDP_RAW"
#define SECTION_FUN_IP_FRAG "IP_FRAG"
#define SECTION_FUN_IP_FRAG_RAW "IP_FRAG_RAW"
#define SECTION_FUN_IPV6_FRAG "IPV6_FRAG"
#define SECTION_FUN_IPV6_FRAG_RAW "IPV6_FRAG_RAW"
/* 2016-09-01 lijia add, phony plug entry, will not be called in fact. */
#define SECTION_FUN_PHONY "PHONY"
/* 2016-09-26 lijia add, polling plug entry, will be called wherether has received packet or not. */
#define SECTION_FUN_POLLING "POLLING"
//20170525 liuyang add for wy serial
#define KEYWORD_PLUGID "PLUGID"
#define KEYWORD_PLUGTYPE "PLUGTYPE"
//add end
#define KEYWORD_PLUGNAME "PLUGNAME"
#define KEYWORD_FILENAME "SO_PATH"
#define KEYWORD_FUNINIT "INIT_FUNC"
#define KEYWORD_FUNDESTROY "DESTROY_FUNC"
#define KEYWORD_FUNUPDATE "UPDATE_FUNC"
//ֻ�н�����������Ҫ
#define KEYWORD_FUNCHANGE "FLAGCHANGE_FUNC"
#define KEYWORD_FUNSTATE "FLAGSTATE_FUNC"
#define KEYWORD_FUNGETID "GETPLUGID_FUNC"
#define KEYWORD_FUNFLAG "FUNC_FLAG"
#define KEYWORD_FUNNAME "FUNC_NAME"
#define FUNFLAG_ALL_B "ALL"
#define FUNFLAG_ALL_S "all"
typedef struct _plugin_entryname_elem
{
char name[PLUGIN_MAX_CONFLEN];
}stEntryNameElem;
typedef struct _plugin_entry_name_info
{
int num;
stEntryNameElem* entryname;
}stEntryNameInfo;
typedef char (*AppEntry)(stSessionInfo* session_info, void **pme, int thread_seq,struct streaminfo *a_stream,const void *a_packet);
//ÿ��Ӧ�ò�Ự��Ҫ�ĺ������
typedef struct _plugin_protocol_session_fun_info
{
long long protflag;
AppEntry appentry;
//modify liuy 20140616 for pending has no flag;
char called_flag;
//modify end
char appstate;
char pre_kill_flag;
void* pme; //ҵ������������Ϣ
struct _plugin_protocol_session_fun_info* next;
}stSessionFunInfo;
extern void* g_plugin_runtime_handle;
extern int stream_register_fun(int funtype,char (*x)(void));
void plugin_call_flagstate();
int process_conf_entryname();
int process_confelem_plugname(char* filename,int plugtype,char** plugname);
int process_conflist(char* filename,int plug_type);
#endif
|