2023-04-03 08:30:49 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <stddef.h>
|
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
|
|
|
|
|
|
2023-04-03 08:30:49 +00:00
|
|
|
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_SSH,
|
|
|
|
|
PROTO_SMTP,
|
|
|
|
|
PROTO_IMAP,
|
|
|
|
|
PROTO_POP3,
|
|
|
|
|
PROTO_RTP,
|
|
|
|
|
PROTO_APP,
|
|
|
|
|
PROTO_L2TP,
|
|
|
|
|
PROTO_PPTP,
|
|
|
|
|
PROTO_STRATUM,
|
|
|
|
|
PROTO_RDP,
|
|
|
|
|
PROTO_DTLS,
|
|
|
|
|
PROTO_MAX
|
|
|
|
|
};
|
2020-08-19 16:56:10 +08:00
|
|
|
|
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;
|
2023-06-14 15:01:51 +08:00
|
|
|
int full_location_len;
|
|
|
|
|
char *full_location;
|
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
|
|
|
|
|
{
|
2022-07-29 10:41:09 +00:00
|
|
|
int ref_cnt;
|
2021-05-19 07:10:25 +00:00
|
|
|
char *apn;
|
|
|
|
|
char *imsi;
|
|
|
|
|
char *imei;
|
|
|
|
|
char *msisdn; //MSISDN: phone number
|
|
|
|
|
};
|
|
|
|
|
|
2022-09-09 14:52:05 +08:00
|
|
|
struct tunnel_catalog
|
|
|
|
|
{
|
|
|
|
|
int id;
|
|
|
|
|
char *name;
|
|
|
|
|
char *type;
|
|
|
|
|
char *composition;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct tunnel_endpoint
|
|
|
|
|
{
|
|
|
|
|
int id;
|
|
|
|
|
int ref_cnt;
|
|
|
|
|
char *description;
|
|
|
|
|
};
|
|
|
|
|
|
2021-09-11 14:08:50 +08:00
|
|
|
struct tsg_conn_sketch_notify_data
|
|
|
|
|
{
|
2023-04-03 08:30:49 +00:00
|
|
|
enum TSG_PROTOCOL protocol;
|
2021-09-11 14:08:50 +08:00
|
|
|
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;
|
2023-04-03 08:30:49 +00:00
|
|
|
long packets;
|
|
|
|
|
long long compile_id;
|
2021-12-28 20:27:37 +03:00
|
|
|
};
|
|
|
|
|
|
2022-06-06 14:45:32 +08:00
|
|
|
struct policy_capture_result
|
|
|
|
|
{
|
2023-04-03 08:30:49 +00:00
|
|
|
long long compile_id;
|
2022-06-06 14:45:32 +08:00
|
|
|
char *packet_path;
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-28 20:27:37 +03:00
|
|
|
struct tsg_notify_data
|
|
|
|
|
{
|
2023-04-03 08:30:49 +00:00
|
|
|
long long compile_id;
|
2021-12-28 20:27:37 +03:00
|
|
|
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
|
|
|
|
|
{
|
2023-04-03 08:30:49 +00:00
|
|
|
enum TSG_PROTOCOL proto; //enum _tsg_protocol (tsg_types.h)
|
2022-07-01 17:08:16 +08:00
|
|
|
union
|
|
|
|
|
{
|
|
|
|
|
struct http_s3_file *s3_http;
|
|
|
|
|
void *pdata;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2023-04-03 08:30:49 +00:00
|
|
|
struct session_runtime_attribute;
|
|
|
|
|
const struct session_runtime_attribute *session_runtime_attribute_get(const struct streaminfo *a_stream);
|
|
|
|
|
const char *srt_attribute_get_ja3_fingerprint(const struct session_runtime_attribute *srt_attribute);
|
|
|
|
|
const char *srt_attribute_get_client_subscriber_id(const struct session_runtime_attribute *srt_attribute);
|
|
|
|
|
const char *srt_attribute_get_server_subscriber_id(const struct session_runtime_attribute *srt_attribute);
|
|
|
|
|
const struct asn_info *srt_attribute_get_client_ip_asn(const struct session_runtime_attribute *srt_attribute);
|
|
|
|
|
const struct asn_info *srt_attribute_get_server_ip_asn(const struct session_runtime_attribute *srt_attribute);
|
|
|
|
|
const struct location_info *srt_attribute_get_client_ip_location(const struct session_runtime_attribute *srt_attribute);
|
|
|
|
|
const struct location_info *srt_attribute_get_server_ip_location(const struct session_runtime_attribute *srt_attribute);
|
|
|
|
|
size_t srt_attribute_get_category_ids(const struct session_runtime_attribute *srt_attribute, unsigned int *category_ids, size_t n_category_ids);
|
|
|
|
|
|
|
|
|
|
int srt_attribute_set_category_ids(const struct streaminfo *a_stream, unsigned int *category_ids, int n_category_ids);
|
|
|
|
|
|
|
|
|
|
struct session_runtime_process_context;
|
|
|
|
|
int session_runtime_process_context_async(const struct streaminfo *a_stream, void *data);
|
|
|
|
|
const struct session_runtime_process_context *session_runtime_process_context_get(const struct streaminfo *a_stream);
|
|
|
|
|
// return NULL; http host or ssl sni or quic sni or dtls sni
|
|
|
|
|
const char *srt_process_context_get_domain(const struct session_runtime_process_context *srt_process_context);
|
|
|
|
|
const char *srt_process_context_get_http_url(const struct session_runtime_process_context *srt_process_context);
|
|
|
|
|
const char *srt_process_context_get_quic_ua(const struct session_runtime_process_context *srt_process_context);
|
|
|
|
|
enum TSG_PROTOCOL srt_process_context_get_protocol(const struct session_runtime_process_context *srt_process_context);
|
2023-05-27 09:37:46 +00:00
|
|
|
unsigned char srt_process_context_get_hitted_allow_flag(const struct session_runtime_process_context *srt_process_context);
|
2023-04-03 08:30:49 +00:00
|
|
|
|