This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
tango-tsg-master/inc/tsg_label.h

108 lines
1.8 KiB
C
Raw Normal View History

#ifndef __TSG_LABEL_H__
#define __TSG_LABEL_H__
2020-09-28 17:13:39 +08:00
#define MAX_CATEGORY_ID_NUM 8
#define MAX_STR_FIELD_LEN 64
#define MAX_RESULT_NUM 8
#define MAX_DOMAIN_LEN 2048
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,
PROTO_L2TP,
PROTO_PPTP,
PROTO_MAX
}tsg_protocol_t;
struct asn_info
{
int ref_cnt;
char *asn_id;
char *organization;
};
struct location_info
{
int ref_cnt;
char *country_full;
char *province_full;
char *city_full;
};
struct subscribe_id_info
{
int ref_cnt;
char *subscribe_id;
};
struct umts_user_info
{
char *apn;
char *imsi;
char *imei;
char *msisdn; //MSISDN: phone number
};
struct session_attribute_label
{
int http_action_file_size;
2020-09-28 17:13:39 +08:00
int fqdn_category_id_num;
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;
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];
struct umts_user_info *user_info;
};
struct policy_priority_label
{
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;
char domain[MAX_DOMAIN_LEN];
Maat_rule_t result[MAX_RESULT_NUM];
};
struct tsg_conn_sketch_notify_data
{
tsg_protocol_t protocol;
union
{
char *mail_eml_filename;
struct TLD_handle_t *TLD_handle;
void *value;
}pdata;
};
#endif