summaryrefslogtreecommitdiff
path: root/entry/include
diff options
context:
space:
mode:
authorfumingwei <[email protected]>2020-08-24 11:33:41 +0800
committerfumingwei <[email protected]>2020-08-24 11:33:41 +0800
commitdca9c67275c27635ca29452ff98e5a385ae98c52 (patch)
tree28f9a9fd6d9ed6939cfdd74d6eaa211cd860d355 /entry/include
parent5313a04d93f38ac24b23170b1238453eb8128816 (diff)
TSG-2846: 增加 kni 对共享tsg_master 扫描maat 结果给tfe的支持
Diffstat (limited to 'entry/include')
-rw-r--r--entry/include/kni_entry.h5
-rw-r--r--entry/include/tsg/tsg_label.h60
2 files changed, 65 insertions, 0 deletions
diff --git a/entry/include/kni_entry.h b/entry/include/kni_entry.h
index 203e7f8..087f623 100644
--- a/entry/include/kni_entry.h
+++ b/entry/include/kni_entry.h
@@ -6,6 +6,7 @@
#include "kni_utils.h"
#include "tsg/tsg_statistic.h"
#include "tfe_mgr.h"
+#include "tsg/tsg_label.h"
#define BURST_MAX 1
#define CALLER_SAPP 0
@@ -14,6 +15,8 @@
#define SSL_INFO_LEN 2048
#define _MAX_MAAT_TABLE_NAME_LEN 64
+#define MAX_STRING_LEN 32
+
enum intercept_error{
INTERCEPT_ERROR_ASYM_ROUTING = -1,
INTERCEPT_ERROR_NO_SYN = -2,
@@ -139,6 +142,7 @@ struct pme_info{
//for proxy tcp option
struct proxy_tcp_option pxy_tcp_option;
int pxy_tcp_option_is_scan;
+ struct _session_attribute_label_t *session_attribute_label;
};
struct wrapped_packet{
@@ -211,6 +215,7 @@ struct kni_handle{
char maat_table_name[TABLE_MAX][_MAX_MAAT_TABLE_NAME_LEN]; // for proxy tcp option maat name
int maat_table_id[TABLE_MAX];
struct proxy_tcp_option pxy_tcp_option;
+ int session_attribute_id;
};
struct traceid2pme_search_cb_args{
diff --git a/entry/include/tsg/tsg_label.h b/entry/include/tsg/tsg_label.h
new file mode 100644
index 0000000..3c82412
--- /dev/null
+++ b/entry/include/tsg/tsg_label.h
@@ -0,0 +1,60 @@
+#ifndef __TSG_LABEL_H__
+#define __TSG_LABEL_H__
+
+#include "tsg_rule.h"
+#define MAX_STR_FIELD_LEN 64
+
+
+struct _asn_info_t
+{
+ int ref_cnt;
+ int addr_type;
+ int table_id;
+ char start_ip[MAX_STR_FIELD_LEN];
+ char end_ip[MAX_STR_FIELD_LEN];
+ char asn[MAX_STR_FIELD_LEN];
+ char organization[MAX_STR_FIELD_LEN*4];
+};
+
+struct _location_info_t
+{
+ int geoname_id;
+ int table_id;
+ int ref_cnt;
+ int addr_type;
+ double latitude;
+ double longitude;
+ double coords;
+ char start_ip[MAX_STR_FIELD_LEN];
+ char end_ip[MAX_STR_FIELD_LEN];
+ char language[MAX_STR_FIELD_LEN];
+ char continent_abbr[MAX_STR_FIELD_LEN*4];
+ char continent_full[MAX_STR_FIELD_LEN*4];
+ char country_abbr[MAX_STR_FIELD_LEN*4];
+ char country_full[MAX_STR_FIELD_LEN*4];
+ char province_abbr[MAX_STR_FIELD_LEN*4];
+ char province_full[MAX_STR_FIELD_LEN*4];
+ char city_full[MAX_STR_FIELD_LEN*4];
+ char time_zone[MAX_STR_FIELD_LEN*4];
+};
+
+struct _subscribe_id_info_t
+{
+ int ref_cnt;
+ int table_id;
+ char subscribe_id[MAX_STR_FIELD_LEN*4];
+};
+
+struct _session_attribute_label_t
+{
+ tsg_protocol_t proto;
+ long establish_latency_ms;
+ struct _asn_info_t *client_asn;
+ struct _asn_info_t *server_asn;
+ struct _location_info_t *client_location;
+ struct _location_info_t *server_location;
+ struct _subscribe_id_info_t *client_subscribe_id;
+ struct _subscribe_id_info_t *server_subscribe_id;
+};
+
+#endif