共享链接属性流标签结构体:https://jira.geedge.net/browse/TSG-2848

This commit is contained in:
liuxueli
2020-08-19 16:56:10 +08:00
parent 7002e1b256
commit 44b8f7be11
7 changed files with 114 additions and 107 deletions

78
inc/tsg_label.h Normal file
View File

@@ -0,0 +1,78 @@
#ifndef __TSG_LABEL_H__
#define __TSG_LABEL_H__
#define MAX_STR_FIELD_LEN 64
typedef enum _tsg_protocol
{
PROTO_UNKONWN=0,
PROTO_IPv4=1,
PROTO_IPv6,
PROTO_TCP,
PROTO_UDP,
PROTO_HTTP,
PROTO_MAIL,
PROTO_DNS,
PROTO_FTP,
PROTO_SSL,
PROTO_SIP,
PROTO_BGP,
PROTO_STREAMING_MEDIA,
PROTO_QUIC,
PROTO_MAX
}tsg_protocol_t;
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

View File

@@ -3,6 +3,8 @@
#include <MESA/Maat_rule.h>
#include "tsg_label.h"
#define TSG_ACTION_NONE 0x00
#define TSG_ACTION_MONITOR 0x01
#define TSG_ACTION_INTERCEPT 0x02
@@ -22,27 +24,6 @@ enum TSG_ETHOD_TYPE
TSG_METHOD_TYPE_MAX
};
typedef enum _tsg_protocol
{
PROTO_UNKONWN=0,
PROTO_IPv4=1,
PROTO_IPv6,
PROTO_TCP,
PROTO_UDP,
PROTO_HTTP,
PROTO_MAIL,
PROTO_DNS,
PROTO_FTP,
PROTO_SSL,
PROTO_SIP,
PROTO_BGP,
PROTO_STREAMING_MEDIA,
PROTO_QUIC,
PROTO_MAX
}tsg_protocol_t;
#define MAX_RESULT_NUM 8
#define MAX_DOAMIN_LEN 2048
@@ -53,18 +34,6 @@ struct _identify_info
char domain[MAX_DOAMIN_LEN];
};
struct _internal_label
{
tsg_protocol_t proto;
long establish_latency_ms;
struct _asn_info *client_asn;
struct _asn_info *server_asn;
struct _location_info *client_location;
struct _location_info *server_location;
struct _subscribe_id_info *client_subscribe_id;
struct _subscribe_id_info *server_subscribe_id;
};
typedef enum _PULL_RESULT_TYPE
{