2020-08-19 16:56:10 +08:00
|
|
|
#ifndef __TSG_LABEL_H__
|
|
|
|
|
#define __TSG_LABEL_H__
|
|
|
|
|
|
2020-09-28 17:13:39 +08:00
|
|
|
#define MAX_CATEGORY_ID_NUM 8
|
2020-08-19 16:56:10 +08:00
|
|
|
#define MAX_STR_FIELD_LEN 64
|
|
|
|
|
|
2021-12-28 20:27:37 +03:00
|
|
|
#define MAX_VLAN_ID_NUM 32
|
|
|
|
|
|
2020-12-14 16:25:55 +06:00
|
|
|
#define MAX_RESULT_NUM 8
|
2021-08-07 17:27:55 +08:00
|
|
|
#define MAX_DOMAIN_LEN 2048
|
2020-12-14 16:25:55 +06:00
|
|
|
|
2020-08-19 16:56:10 +08:00
|
|
|
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,
|
2020-08-24 16:37:20 +08:00
|
|
|
PROTO_SSH,
|
2020-09-02 19:44:15 +08:00
|
|
|
PROTO_SMTP,
|
|
|
|
|
PROTO_IMAP,
|
|
|
|
|
PROTO_POP3,
|
2021-02-23 15:23:54 +08:00
|
|
|
PROTO_RTP,
|
2021-03-02 10:39:33 +08:00
|
|
|
PROTO_APP,
|
2021-11-30 23:46:30 +03:00
|
|
|
PROTO_L2TP,
|
|
|
|
|
PROTO_PPTP,
|
2022-02-11 02:59:23 +00:00
|
|
|
PROTO_STRATUM,
|
2022-05-16 02:15:23 +00:00
|
|
|
PROTO_RDP,
|
2020-08-19 16:56:10 +08:00
|
|
|
PROTO_MAX
|
|
|
|
|
}tsg_protocol_t;
|
|
|
|
|
|
|
|
|
|
|
2021-08-07 17:27:55 +08:00
|
|
|
struct asn_info
|
2020-08-19 16:56:10 +08:00
|
|
|
{
|
|
|
|
|
int ref_cnt;
|
2021-08-07 17:27:55 +08:00
|
|
|
char *asn_id;
|
|
|
|
|
char *organization;
|
2020-08-19 16:56:10 +08:00
|
|
|
};
|
|
|
|
|
|
2021-08-07 17:27:55 +08:00
|
|
|
struct location_info
|
2020-08-19 16:56:10 +08:00
|
|
|
{
|
|
|
|
|
int ref_cnt;
|
2021-08-07 17:27:55 +08:00
|
|
|
char *country_full;
|
|
|
|
|
char *province_full;
|
|
|
|
|
char *city_full;
|
2022-02-10 02:46:49 +00:00
|
|
|
char *subdivision_addr;
|
2020-08-19 16:56:10 +08:00
|
|
|
};
|
|
|
|
|
|
2021-08-07 17:27:55 +08:00
|
|
|
struct subscribe_id_info
|
2020-08-19 16:56:10 +08:00
|
|
|
{
|
|
|
|
|
int ref_cnt;
|
2021-08-07 17:27:55 +08:00
|
|
|
char *subscribe_id;
|
2020-08-19 16:56:10 +08:00
|
|
|
};
|
|
|
|
|
|
2021-05-19 07:10:25 +00:00
|
|
|
struct umts_user_info
|
|
|
|
|
{
|
|
|
|
|
char *apn;
|
|
|
|
|
char *imsi;
|
|
|
|
|
char *imei;
|
|
|
|
|
char *msisdn; //MSISDN: phone number
|
|
|
|
|
};
|
|
|
|
|
|
2021-08-07 17:27:55 +08:00
|
|
|
struct session_attribute_label
|
2020-08-19 16:56:10 +08:00
|
|
|
{
|
2021-08-07 17:27:55 +08:00
|
|
|
int http_action_file_size;
|
2020-09-28 17:13:39 +08:00
|
|
|
int fqdn_category_id_num;
|
2020-08-19 16:56:10 +08:00
|
|
|
tsg_protocol_t proto;
|
|
|
|
|
long establish_latency_ms;
|
2021-08-07 17:27:55 +08:00
|
|
|
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;
|
2020-09-11 18:06:09 +08:00
|
|
|
char *ja3_fingerprint;
|
2020-09-28 17:13:39 +08:00
|
|
|
unsigned int fqdn_category_id[MAX_CATEGORY_ID_NUM];
|
2021-05-19 07:10:25 +00:00
|
|
|
struct umts_user_info *user_info;
|
2020-08-19 16:56:10 +08:00
|
|
|
};
|
|
|
|
|
|
2021-08-07 17:27:55 +08:00
|
|
|
struct policy_priority_label
|
2020-12-14 16:25:55 +06:00
|
|
|
{
|
|
|
|
|
tsg_protocol_t proto; //enum _tsg_protocol (tsg_types.h)
|
|
|
|
|
int domain_len;
|
|
|
|
|
int result_type; //enum _PULL_RESULT_TYPE (tsg_rule.h)
|
|
|
|
|
int result_num;
|
2022-06-02 10:48:00 +08:00
|
|
|
union
|
|
|
|
|
{
|
|
|
|
|
char *http_url;
|
|
|
|
|
char *quic_ua;
|
|
|
|
|
void *para;
|
|
|
|
|
};
|
2021-08-07 17:27:55 +08:00
|
|
|
char domain[MAX_DOMAIN_LEN];
|
2020-12-14 16:25:55 +06:00
|
|
|
Maat_rule_t result[MAX_RESULT_NUM];
|
2021-08-07 17:27:55 +08:00
|
|
|
};
|
2020-12-14 16:25:55 +06:00
|
|
|
|
2021-09-11 14:08:50 +08:00
|
|
|
|
|
|
|
|
struct tsg_conn_sketch_notify_data
|
|
|
|
|
{
|
|
|
|
|
tsg_protocol_t protocol;
|
|
|
|
|
union
|
|
|
|
|
{
|
|
|
|
|
char *mail_eml_filename;
|
2021-11-08 13:11:48 +03:00
|
|
|
struct TLD_handle_t *TLD_handle;
|
2021-09-11 14:08:50 +08:00
|
|
|
void *value;
|
|
|
|
|
}pdata;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2021-12-28 20:27:37 +03:00
|
|
|
enum NOTIFY_TYPE
|
|
|
|
|
{
|
|
|
|
|
NOTIFY_TYPE_MIRRORED=0,
|
|
|
|
|
NOTIFY_TYPE_CAPTURE,
|
|
|
|
|
NOTIFY_TYPE_MAX
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct mirrored_vlan
|
|
|
|
|
{
|
|
|
|
|
int num;
|
|
|
|
|
int id[MAX_VLAN_ID_NUM];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct mirrored_stat
|
|
|
|
|
{
|
|
|
|
|
long bytes;
|
|
|
|
|
long packets;
|
|
|
|
|
int compile_id;
|
|
|
|
|
};
|
|
|
|
|
|
2022-06-06 14:45:32 +08:00
|
|
|
struct policy_capture_result
|
|
|
|
|
{
|
|
|
|
|
int compile_id;
|
|
|
|
|
char *packet_path;
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-28 20:27:37 +03:00
|
|
|
struct tsg_notify_data
|
|
|
|
|
{
|
|
|
|
|
int compile_id;
|
|
|
|
|
enum NOTIFY_TYPE type;
|
|
|
|
|
union
|
|
|
|
|
{
|
|
|
|
|
int capture_depth;
|
|
|
|
|
struct mirrored_vlan *vlan;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct tsg_notify_execution_result
|
|
|
|
|
{
|
|
|
|
|
int stat_mirrored_cnt;
|
2022-06-06 14:45:32 +08:00
|
|
|
int capture_result_cnt;
|
|
|
|
|
struct policy_capture_result capture_result[MAX_RESULT_NUM];
|
2021-12-28 20:27:37 +03:00
|
|
|
struct mirrored_stat stat_mirrored[MAX_RESULT_NUM];
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-29 21:59:35 +03:00
|
|
|
struct application_behavior
|
|
|
|
|
{
|
|
|
|
|
char *stream_behavior;
|
|
|
|
|
};
|
|
|
|
|
|
2022-07-01 17:08:16 +08:00
|
|
|
struct http_s3_file
|
|
|
|
|
{
|
|
|
|
|
char *request_filename;
|
|
|
|
|
char *response_filename;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct business_notify_data
|
|
|
|
|
{
|
|
|
|
|
tsg_protocol_t proto; //enum _tsg_protocol (tsg_types.h)
|
|
|
|
|
union
|
|
|
|
|
{
|
|
|
|
|
struct http_s3_file *s3_http;
|
|
|
|
|
void *pdata;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2020-08-19 16:56:10 +08:00
|
|
|
#endif
|