summaryrefslogtreecommitdiff
path: root/src/ntc_ip_comm.h
blob: f70a31f164ca9d17136bb4240826fb7112bdab35 (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
#ifndef NTC_IP_COMM_H
#define NTC_IP_COMM_H


#ifdef __cplusplus
extern "C"
{
#endif

#include "stream.h"

	typedef   struct  ntc_ip_comm_global_item
	{
		void * log_handle;
		char log_path[1024];
		unsigned int log_level;
		unsigned int comm_log_mode;
		unsigned int indie_kafka;
		char kafka_brokelist[1024];
		char kafka_handle_provide_path[1024];
		char kafka_handle_name[1024];
		char kafka_topic[1024];

        unsigned int local_ip_nr;
        char local_ip_str[128];
        char dpkt_label[1024];
        int dpkt_project_id;

        int tcp_flow_id;
        int udp_flow_id;

        int entry_id;
        int service;
		unsigned int min_bytes;
		unsigned int min_pkts;

	}ntc_ip_comm_global_item;

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


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

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


    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 struct _comm_context_t
    {
        unsigned long long c2s_pkts;
        unsigned long long s2c_pkts;
        unsigned long long c2s_bytes;
        unsigned long long s2c_bytes;
     }comm_context_t;


#ifdef __cplusplus
}
#endif

#endif