summaryrefslogtreecommitdiff
path: root/src/dns_jt_audit.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/dns_jt_audit.h')
-rw-r--r--src/dns_jt_audit.h105
1 files changed, 105 insertions, 0 deletions
diff --git a/src/dns_jt_audit.h b/src/dns_jt_audit.h
new file mode 100644
index 0000000..5a60eb7
--- /dev/null
+++ b/src/dns_jt_audit.h
@@ -0,0 +1,105 @@
+#ifndef DNS_SERVICE_H
+#define DNS_SERVICE_H
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <assert.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <pthread.h>
+#include <netinet/ip6.h>
+#include <netinet/in.h>
+
+//#include <MESA_SDK.h>
+#include <MESA/stream.h>
+#include <MESA/field_stat.h>
+#include <MESA/MESA_handle_logger.h>
+#include <MESA/Maat_rule.h>
+#include <MESA/MESA_prof_load.h>
+
+#include "inc/dj_rule.h"
+#include "inc/dns_analyse.h"
+#include "inc/ip_jt.h"
+#include "inc/qdjcq_magellan_id.h"
+#include "MESA/magellan_logger.h"
+
+
+//#define DNS_SRV_FLAG 0x01
+//
+#define DNS_PLUGIN_ID 34
+//#define DNS_UDP_PROTOCOL 17
+
+#define MAX_MAGELLON_OPT_NUM 5
+
+#define MAX_RES_IP_BUF_LEN 512
+#define MAX_CNAME_INFO_BUF_LEN 1024
+#define MAX_KEY_LEN 512
+
+#define MAX_SUPPORT_RULE_SIZE 16
+#define MAX_LOG_FILE_PATH_LENGTH 80
+#define DJ_DEBUG_ON 1
+#define DNS_SERVICE_LOG_OPT_NUM 6
+
+#define REGISTER_TABLE_NUM 1
+#define REGISTER_TABLE_DOMAIN 0
+#define REGISTER_TABLE_IP_GEO 1
+
+#define DOMAIN_BLACK_CHAR 1
+#define DOMAIN_GRAY_CHAR 3
+#define DOMAIN_WHITE_CHAR 1
+
+#define SCC_CHAR_FOREIGN 0
+#define SCC_CHAR_DALU 1
+#define SCC_CHAR_TAIWAN 2
+#define SCC_CHAR_HONKON 3
+#define SCC_CHAR_MACOU 4
+#define SCC_CHAR_OTHER 5
+#define SCC_CHAR_LOCAL 6
+
+#define IPC_WHITE_IP_TYPE 1
+#define IPC_BLACK_IP_TYPE 2
+
+#define DNS_BUSINESS 2
+#define REGISTER_TABLE_URL_PZ 0
+
+#define MAX_RESULT_NUM 16
+
+#define SEND_LOG_MAGELLAN_OPT_NUM 32
+
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+typedef struct _process_context
+{
+ int do_blacklist;
+ int hit_config_num;
+ int m_opt_index;
+ int respone_flag;
+ magellan_opt_t m_opt[SEND_LOG_MAGELLAN_OPT_NUM];
+}process_context_t;
+
+
+typedef struct dns_service_config_t
+{
+ int debug_info;
+ int log_level;
+ int audit_level;
+ int table_id[REGISTER_TABLE_NUM];
+ void *log_handle;
+ char log_path[MAX_LOG_FILE_PATH_LENGTH];
+}dns_service_conf;
+
+int dj_dns_scan_domain(dns_response_t* dns_info,struct streaminfo *dns_stream, void *a_packet,magellan_opt_t *m_opt,int thread_num);
+char dj_dns_service_entry (stSessionInfo *session_info, void **pme, int thread_seq, struct streaminfo *a_udp, void *a_packet);
+int dj_dns_service_init();
+void dj_dns_service_destory();
+
+#ifdef __cplusplus
+}
+#endif
+#endif