summaryrefslogtreecommitdiff
path: root/src/ntc_ssl_collect.h
blob: b85387f9665a880839963b89f24173bb4f540cd5 (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
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
112
113
114
115
116
117
#ifndef NTC_SSL_COLLECT_H
#define NTC_SSL_COLLECT_H


#ifdef __cplusplus
extern "C"
{
#endif

#include "stream.h"
	//#include "soq/identify_v2.h"
#include <cJSON.h>

	typedef   struct  ntc_ssl_collect_global_item
	{
		void * log_handle;
		char log_path[1024];
		unsigned int log_level;
		unsigned int comm_log_mode;
		char kafka_brokelist[1024];
		char kafka_topic[1024];
		char dpkt_label[1024];
		int dpkt_project_id;

		int collect_all_sw;
		int collect_san_sw;

		char kafka_handle_provide_path[1024];
		char kafka_handle_name[1024];


		int tcp_flow_id;
		int udp_flow_id;

		unsigned int local_ip_nr;
		char local_ip_str[128];

		int entry_id;
		int service;
	}ntc_ssl_collect_global_item;

	/*
	   typedef struct _dpkt_lable_t
	   {
	   unsigned char trans_proto;
	   unsigned char v6;
	   unsigned short _pad0;
	   unsigned int dpkt_service_type;
	   unsigned int dpkt_proto_type;
	   unsigned int dpkt_app_type;
	   unsigned int dpkt_op_type;
	   unsigned int dpkt_browser_type;
	   unsigned int dpkt_web_type;
	   unsigned int dpkt_behavior_type;
	   }dpkt_lable_t;
	   */

	//typedef stDntyProInfoV2 dpkt_lable_t;
	typedef struct _dpkt_lable_t
	{
		unsigned char trans_proto;
		unsigned char v6;
		unsigned short _pad0;
		//      uint16_t dpkt_app_ser_type;
		//      uint16_t dpkt_proto_ser_type;
		unsigned int dpkt_proto_type;
		unsigned int dpkt_app_type;
		unsigned int dpkt_op_type;
		unsigned int dpkt_browser_type;
		unsigned int dpkt_web_type;
		unsigned int dpkt_behavior_type;
	}dpkt_lable_t;


	typedef struct _comm_context_t
	{
		unsigned long long c2s_pkts;
		unsigned long long s2c_pkts;
		unsigned long long c2s_bytes;
		unsigned long long s2c_bytes;
		cJSON *client_cert;
		cJSON *server_cert;
		char *client_ciphersuits;
		char *server_ciphersuits;
	}comm_context_t;


	typedef enum
	{
		OK = 0,
		ERROR = -1,
		UNDEFINE = -2
	} STATUS;

	typedef enum
	{
		TRUE = 1,
		FALSE = 0
	} BOOL;

	typedef enum
	{
		SEND_NONE = 0,
		SEND_KAFKA = 1,
		INDIE_KAFKA = 2,
		SEND_LOG = 4
	} NTC_COMM_MODE_MASK;


#ifdef __cplusplus
}
#endif

#endif