create version
This commit is contained in:
1
inc/tsg_entry.h
Normal file
1
inc/tsg_entry.h
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
131
inc/tsg_log_id.h
Normal file
131
inc/tsg_log_id.h
Normal file
@@ -0,0 +1,131 @@
|
||||
#ifndef __TSG_CABOT_LOG_ID_H__
|
||||
#define __TSG_CABOT_LOG_ID_H__
|
||||
|
||||
#define CABOT_LOG_OPT_POLICY_ID 1
|
||||
#define CABOT_LOG_OPT_POLICY_SERVICE 2
|
||||
#define CABOT_LOG_OPT_POLICY_ACTION 3
|
||||
#define CABOT_LOG_OPT_START_TIME 4
|
||||
#define CABOT_LOG_OPT_END_TIME 5
|
||||
#define CABOT_LOG_OPT_L4_PROTOCL 6
|
||||
#define CABOT_LOG_OPT_ADDRESS_TYPE 7
|
||||
#define CABOT_LOG_OPT_SERVER_IP 8
|
||||
#define CABOT_LOG_OPT_CLIENT_IP 9
|
||||
#define CABOT_LOG_OPT_SERVER_PORT 10
|
||||
#define CABOT_LOG_OPT_CLIENT_PORT 11
|
||||
#define CABOT_LOG_OPT_STREAM_DIR 12
|
||||
#define CABOT_LOG_OPT_ADDRESS_LIST 13
|
||||
|
||||
#define CABOT_LOG_OPT_ENTRANCE_ID 14
|
||||
#define CABOT_LOG_OPT_DEVICE_ID 15
|
||||
#define CABOT_LOG_OPT_LINK_ID 16
|
||||
#define CABOT_LOG_OPT_ISP 17
|
||||
#define CABOT_LOG_OPT_ENCAPSULATION 18
|
||||
#define CABOT_LOG_OPT_DIRECTION 19
|
||||
#define CABOT_LOG_OPT_SLED_IP 20
|
||||
|
||||
#define CABOT_LOG_OPT_USER_TAGS 21
|
||||
#define CABOT_LOG_OPT_USER_REGION 22
|
||||
#define CABOT_LOG_OPT_APP_ID 23
|
||||
#define CABOT_LOG_OPT_PROTOCIL_ID 24
|
||||
#define CABOT_LOG_OPT_C2S_PKT_NUM 25
|
||||
#define CABOT_LOG_OPT_S2C_PKT_NUM 26
|
||||
#define CABOT_LOG_OPT_C2S_BYTE_NUM 27
|
||||
#define CABOT_LOG_OPT_S2C_BYTE_NUM 28
|
||||
#define CABOT_LOG_OPT_CON_DURATION_MS 29
|
||||
#define CABOT_LOG_OPT_CON_LATENCY_MS 30
|
||||
#define CABOT_LOG_OPT_STREAM_TRACE_ID 31
|
||||
|
||||
#define CABOT_LOG_OPT_HTTP_URL 32
|
||||
#define CABOT_LOG_OPT_HTTP_REQUEST_LINE 33
|
||||
#define CABOT_LOG_OPT_HTTP_RESPONSE_LINE 34
|
||||
#define CABOT_LOG_OPT_HTTP_REQUEST_HEADER 35
|
||||
#define CABOT_LOG_OPT_HTTP_RESPONSE_HEADER 36
|
||||
#define CABOT_LOG_OPT_HTTP_REQUEST_BODY 37
|
||||
#define CABOT_LOG_OPT_HTTP_RESPONSE_BODY 38
|
||||
#define CABOT_LOG_OPT_HTTP_C2S_ISN 39
|
||||
#define CABOT_LOG_OPT_HTTP_PROXY_FLAG 40
|
||||
#define CABOT_LOG_OPT_HTTP_SEQUENCE 41
|
||||
#define CABOT_LOG_OPT_HTTP_SNAPSHOT 42
|
||||
#define CABOT_LOG_OPT_HTTP_COOKIE 43
|
||||
#define CABOT_LOG_OPT_HTTP_REFERER 44
|
||||
#define CABOT_LOG_OPT_HTTP_USER_AGENT 45
|
||||
#define CABOT_LOG_OPT_HTTP_CONTENT_LENGTH 46
|
||||
#define CABOT_LOG_OPT_HTTP_CONTENT_TYPE 47
|
||||
#define CABOT_LOG_OPT_HTTP_SET_COOKIE 48
|
||||
|
||||
|
||||
#define CABOT_LOG_OPT_MAIL_PROTOCOL 51
|
||||
#define CABOT_LOG_OPT_MAIL_SENDER 52
|
||||
#define CABOT_LOG_OPT_MAIL_RECEIVER 53
|
||||
#define CABOT_LOG_OPT_MAIL_SUBJECT 54
|
||||
#define CABOT_LOG_OPT_MAIL_CONTENT 55
|
||||
#define CABOT_LOG_OPT_MAIL_ATTACHMENT_NAME 56
|
||||
#define CABOT_LOG_OPT_MAIL_ATTACHMENT_CONTENT 57
|
||||
#define CABOT_LOG_OPT_MAIL_EML_FILE 58
|
||||
#define CABOT_LOG_OPT_MAIL_SNAPSHOT 59
|
||||
|
||||
|
||||
#define CABOT_LOG_OPT_DNS_MESSAGE_ID 61
|
||||
#define CABOT_LOG_OPT_DNS_QR 62
|
||||
#define CABOT_LOG_OPT_DNS_OPCODE 63
|
||||
#define CABOT_LOG_OPT_DNS_AA 64
|
||||
#define CABOT_LOG_OPT_DNS_TC 65
|
||||
#define CABOT_LOG_OPT_DNS_RD 66
|
||||
#define CABOT_LOG_OPT_DNS_RA 67
|
||||
#define CABOT_LOG_OPT_DNS_RCODE 68
|
||||
#define CABOT_LOG_OPT_DNS_QDCOUNT 69
|
||||
#define CABOT_LOG_OPT_DNS_ANCOUNT 70
|
||||
#define CABOT_LOG_OPT_DNS_NSCOUNT 71
|
||||
#define CABOT_LOG_OPT_DNS_ARCOUNT 72
|
||||
#define CABOT_LOG_OPT_DNS_QNAME 73
|
||||
#define CABOT_LOG_OPT_DNS_QTYPE 74
|
||||
#define CABOT_LOG_OPT_DNS_QCLASS 75
|
||||
#define CABOT_LOG_OPT_DNS_CNAME 76
|
||||
#define CABOT_LOG_OPT_DNS_SUB 77
|
||||
#define CABOT_LOG_OPT_DNS_RR 78
|
||||
|
||||
|
||||
#define CABOT_LOG_OPT_SSL_VERSION 81
|
||||
#define CABOT_LOG_OPT_SSL_SNI 82
|
||||
#define CABOT_LOG_OPT_SSL_SAN 83
|
||||
#define CABOT_LOG_OPT_SSL_CN 84
|
||||
|
||||
#define CABOT_LOG_OPT_FTP_URL 88
|
||||
#define CABOT_LOG_OPT_FTP_CONTENT 89
|
||||
|
||||
#define CABOT_LOG_OPT_VOIP_CALLING_ACCOUNT 90
|
||||
#define CABOT_LOG_OPT_VOIP_CALLED_ACCOUNT 91
|
||||
#define CABOT_LOG_OPT_VOIP_CALLING_NUMBER 92
|
||||
#define CABOT_LOG_OPT_VOIP_CALLED_NUMBER 93
|
||||
|
||||
#define CABOT_LOG_OPT_BGP_PACKET_TYPE 100
|
||||
#define CABOT_LOG_OPT_BGP_AS_NUM 101
|
||||
#define CABOT_LOG_OPT_BGP_ROUTE 102
|
||||
|
||||
#define CABOT_LOG_OPT_RADIUS_PACKET_TYPE 112
|
||||
#define CABOT_LOG_OPT_RADIUS_ACCOUNT 113
|
||||
#define CABOT_LOG_OPT_RADIUS_CALLBACK_NUMBER 114
|
||||
#define CABOT_LOG_OPT_RADIUS_CALLBACK_ID 115
|
||||
#define CABOT_LOG_OPT_RADIUS_CALLED_STATION_ID 116
|
||||
#define CABOT_LOG_OPT_RADIUS_CALLING_STATION_ID 117
|
||||
#define CABOT_LOG_OPT_RADIUS_ACCT_SESSION_ID 118
|
||||
#define CABOT_LOG_OPT_RADIUS_ACCT_MULTI_SESSION_ID 119
|
||||
#define CABOT_LOG_OPT_RADIUS_NAS_IP_ADDRESS 120
|
||||
#define CABOT_LOG_OPT_RADIUS_FRAMED_IP_ADDRESS 121
|
||||
#define CABOT_LOG_OPT_RADIUS_FRAMED_IP_NETMASK 122
|
||||
#define CABOT_LOG_OPT_RADIUS_SERVICE_TYPE 123
|
||||
#define CABOT_LOG_OPT_RADIUS_FRAMED_MTU 124
|
||||
#define CABOT_LOG_OPT_RADIUS_SESSION_TIMEOUT 125
|
||||
#define CABOT_LOG_OPT_RADIUS_IDLE_TIMEOUT 126
|
||||
#define CABOT_LOG_OPT_RADIUS_TERMINATION_CATION 127
|
||||
#define CABOT_LOG_OPT_RADIUS_PROXY_STATE 128
|
||||
#define CABOT_LOG_OPT_RADIUS_ACCT_STATUS_TYPE 129
|
||||
#define CABOT_LOG_OPT_RADIUS_ACCT_INPUT_OCTETS 130
|
||||
#define CABOT_LOG_OPT_RADIUS_ACCT_INPUT_PACKETS 131
|
||||
#define CABOT_LOG_OPT_RADIUS_ACCT_OUTPUT_OCTETS 132
|
||||
#define CABOT_LOG_OPT_RADIUS_ACCT_OUTPUT_PACKETS 133
|
||||
#define CABOT_LOG_OPT_RADIUS_ACCT_TERMINATE_CAUSE 134
|
||||
#define CABOT_LOG_OPT_RADIUS_ACCT_LINK_COUNT 135
|
||||
#define CABOT_LOG_OPT_RADIUS_ACCT_INTERIM_INTERVAL 136
|
||||
|
||||
#endif
|
||||
38
inc/tsg_rule.h
Normal file
38
inc/tsg_rule.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef __TSG_RULE_H__
|
||||
#define __TSG_RULE_H__
|
||||
|
||||
#include <MESA/Maat_rule.h>
|
||||
#include "tsg_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
|
||||
typedef enum _PULL_RESULT_TYPE
|
||||
{
|
||||
PULL_KNI_RESULT,
|
||||
PULL_FW_RESULT
|
||||
}PULL_RESULT_TYPE;
|
||||
|
||||
extern Maat_feather_t g_tsg_maat_feather;
|
||||
|
||||
|
||||
int tsg_scan_nesting_addr(Maat_feather_t maat_feather, const struct streaminfo *a_stream, tsg_protocol_t proto, scan_status_t *mid, Maat_rule_t*result, int result_num);
|
||||
|
||||
//return 0 if failed, return >0 on success;
|
||||
int tsg_pull_policy_result(PULL_RESULT_TYPE pull_result_type, Maat_rule_t *result, int result_num);
|
||||
|
||||
//return -1 if failed, return 0 on success;
|
||||
int tsg_shared_table_init(const char *conffile, Maat_feather_t maat_feather, void *logger);
|
||||
|
||||
//return -1 if failed, return 0 on success;
|
||||
int tsg_scan_shared_policy(Maat_feather_t maat_feather, void *pkt, int pkt_len, Maat_rule_t *result, int result_num, scan_status_t *mid, void *logger, int thread_seq);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
35
inc/tsg_send_log.h
Normal file
35
inc/tsg_send_log.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef __TSG_SEND_LOG_H__
|
||||
#define __TSG_SEND_LOG_H__
|
||||
|
||||
#include <MESA/Maat_rule.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
|
||||
struct _opt_unit_t
|
||||
{
|
||||
int opt_type;
|
||||
int opt_len;
|
||||
char *opt_value;
|
||||
};
|
||||
|
||||
typedef struct _tsg_log
|
||||
{
|
||||
int result_num;
|
||||
Maat_rule_t *result;
|
||||
struct streaminfo *a_stream;
|
||||
}tsg_log_t;
|
||||
|
||||
|
||||
int tsg_sendlog_init(char *filename);
|
||||
void tsg_send_log(const tsg_log_t* log_msg, struct _opt_unit_t* log_opt, int opt_num, int thread_id);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
109
inc/tsg_types.h
Normal file
109
inc/tsg_types.h
Normal file
@@ -0,0 +1,109 @@
|
||||
#ifndef __TSG_TYPES_H__
|
||||
#define __TSG_TYPES_H__
|
||||
|
||||
typedef enum _tsg_opt
|
||||
{
|
||||
LOG_OPT_HTTP_URL=1,
|
||||
LOG_OPT_HTTP_HOST,
|
||||
LOG_OPT_HTTP_REQUEST_LINE,
|
||||
LOG_OPT_HTTP_RESPONSE_LINE,
|
||||
LOG_OPT_HTTP_REQUEST_HEADER,
|
||||
LOG_OPT_HTTP_RESPONSE_HEADER,
|
||||
LOG_OPT_HTTP_REQUEST_BODY,
|
||||
LOG_OPT_HTTP_RESPONSE_BODY,
|
||||
LOG_OPT_HTTP_PROXY_FLAG,
|
||||
LOG_OPT_HTTP_SEQUENCE,
|
||||
LOG_OPT_HTTP_SNAPSHOT,
|
||||
LOG_OPT_HTTP_COOKIE,
|
||||
LOG_OPT_HTTP_REFERER,
|
||||
LOG_OPT_HTTP_USER_AGENT,
|
||||
LOG_OPT_HTTP_CONTENT_LENGTH,
|
||||
LOG_OPT_HTTP_CONTENT_TYPE,
|
||||
LOG_OPT_HTTP_SET_COOKIE,
|
||||
LOG_OPT_HTTP_VERSION,
|
||||
|
||||
LOG_OPT_MAIL_PROTOCOL_TYPE,
|
||||
LOG_OPT_MAIL_SENDER,
|
||||
LOG_OPT_MAIL_RECEIVER,
|
||||
LOG_OPT_MAIL_SUBJECT,
|
||||
LOG_OPT_MAIL_CONTENT,
|
||||
LOG_OPT_MAIL_ATTACHMENT_NAME,
|
||||
LOG_OPT_MAIL_ATTACHMENT_CONTENT,
|
||||
LOG_OPT_MAIL_EML_FILE,
|
||||
LOG_OPT_MAIL_SNAPSHOT,
|
||||
LOG_OPT_MAIL_SUBJECT_CHARSET,
|
||||
|
||||
LOG_OPT_DNS_MESSAGE_ID,
|
||||
LOG_OPT_DNS_QR,
|
||||
LOG_OPT_DNS_OPCODE,
|
||||
LOG_OPT_DNS_AA,
|
||||
LOG_OPT_DNS_TC,
|
||||
LOG_OPT_DNS_RD,
|
||||
LOG_OPT_DNS_RA,
|
||||
LOG_OPT_DNS_RCODE,
|
||||
LOG_OPT_DNS_QDCOUNT,
|
||||
LOG_OPT_DNS_ANCOUNT,
|
||||
LOG_OPT_DNS_NSCOUNT,
|
||||
LOG_OPT_DNS_ARCOUNT,
|
||||
LOG_OPT_DNS_QNAME,
|
||||
LOG_OPT_DNS_QTYPE,
|
||||
LOG_OPT_DNS_QCLASS,
|
||||
LOG_OPT_DNS_CNAME,
|
||||
LOG_OPT_DNS_SUB,
|
||||
LOG_OPT_DNS_RR,
|
||||
|
||||
LOG_OPT_SSL_VERSION,
|
||||
LOG_OPT_SSL_SNI,
|
||||
LOG_OPT_SSL_SAN,
|
||||
LOG_OPT_SSL_CN,
|
||||
LOG_OPT_SSL_PINNINGST,
|
||||
LOG_OPT_SSL_INTERCEPT_STATE,
|
||||
LOG_OPT_SSL_SERVER_SIDE_LATENCY,
|
||||
LOG_OPT_SSL_CLINET_SIDE_LATENCY,
|
||||
LOG_OPT_SSL_SERVER_SIDE_VERSION,
|
||||
LOG_OPT_SSL_CLIENT_SIDE_VERSION,
|
||||
LOG_OPT_SSL_CERT_VERIFY,
|
||||
LOG_OPT_SSL_ERROR,
|
||||
LOG_OPT_SSL_CON_LATENCY_MS,
|
||||
|
||||
LOG_OPT_FTP_URL,
|
||||
LOG_OPT_FTP_CONTENT,
|
||||
|
||||
LOG_OPT_BGP_TYPE,
|
||||
LOG_OPT_BGP_AS_NUM,
|
||||
LOG_OPT_BGP_ROUTE,
|
||||
|
||||
LOG_OPT_VOIP_CALLING_ACCOUNT,
|
||||
LOG_OPT_VOIP_CALLED_ACCOUNT,
|
||||
LOG_OPT_VOIP_CALLING_NUMBER,
|
||||
LOG_OPT_VOIP_CALLED_NUMBER,
|
||||
|
||||
LOG_OPT_RADIUS_PACKET_TYPE,
|
||||
LOG_OPT_RADIUS_NAS_IP,
|
||||
LOG_OPT_RADIUS_FRAMED_IP,
|
||||
LOG_OPT_RADIUS_ACCOUNT,
|
||||
LOG_OPT_RADIUS_SEESION_TIMEOUT,
|
||||
LOG_OPT_RADIUS_IDLE_TIMEOUT,
|
||||
LOG_OPT_RADIUS_ACCT_STATUS_TYPE,
|
||||
LOG_OPT_RADIUS_ACCT_TERMINATE_CAUSE,
|
||||
LOG_OPT_MAX
|
||||
}tsg_opt_t;
|
||||
|
||||
typedef enum _tsg_protocol
|
||||
{
|
||||
PROTO_IPv4,
|
||||
PROTO_IPv6,
|
||||
PROTO_TCP,
|
||||
PROTO_UDP,
|
||||
PROTO_HTTP,
|
||||
PROTO_MAIL,
|
||||
PROTO_DNS,
|
||||
PROTO_FTP,
|
||||
PROTO_SSL,
|
||||
PROTO_SIP,
|
||||
PROTO_BGP,
|
||||
PROTO_STREAMING_MEDIA,
|
||||
PROTO_MAX
|
||||
}tsg_protocol_t;
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user