summaryrefslogtreecommitdiff
path: root/include/private/plugin.h
diff options
context:
space:
mode:
authorlijia <[email protected]>2019-05-17 18:27:07 +0800
committerlijia <[email protected]>2019-05-17 18:27:07 +0800
commita24c12255ef2925beb22d5fb5f29b237a5842946 (patch)
tree0af85274f9b5de8b24af1ec67d3aa29498879789 /include/private/plugin.h
parentcbfa143e269631fb95815d8adb6b350efcc310af (diff)
sapp update to version 4.0.
Diffstat (limited to 'include/private/plugin.h')
-rw-r--r--include/private/plugin.h117
1 files changed, 117 insertions, 0 deletions
diff --git a/include/private/plugin.h b/include/private/plugin.h
new file mode 100644
index 0000000..0310532
--- /dev/null
+++ b/include/private/plugin.h
@@ -0,0 +1,117 @@
+#ifndef _PLUGIN_H
+#define _PLUGIN_H
+
+#include <netinet/ip.h>
+#include "stream.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#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);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
+