2018-09-29 14:57:32 +08:00
|
|
|
|
#ifndef _AV_INTERFACE_H
|
|
|
|
|
|
#define _AV_INTERFACE_H
|
|
|
|
|
|
|
|
|
|
|
|
#define PROTO_VERSION 3
|
|
|
|
|
|
#define PROTO_MAGICNUM 0x5641
|
|
|
|
|
|
|
|
|
|
|
|
/*META_OPT_* same with av_master <20><><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0>*/
|
|
|
|
|
|
#define META_OPT_LAYER_ADDR 0x52 //META_OPT_LAYER_ADDR
|
|
|
|
|
|
#define META_OPT_SINGLE_KEY 0x68
|
|
|
|
|
|
#define META_OPT_LAYER_URL 0x61
|
|
|
|
|
|
#define META_OPT_ETAG 0x62
|
|
|
|
|
|
#define META_OPT_LAST_MODIFY 0x63
|
|
|
|
|
|
#define META_OPT_REFERER 0x64 //AV_IdentifyFormatDoc
|
|
|
|
|
|
#define META_OPT_USER_AGENT 0x65
|
|
|
|
|
|
#define META_OPT_C2S_CONT_TYPE 0x66 //cache and send because of boundary
|
|
|
|
|
|
#define META_OPT_S2C_CONT_TYPE 0x67 //cache and send because of boundary
|
|
|
|
|
|
#define META_OPT_SERVICE_ID 0x71 /*<2A><>Ƭ<EFBFBD><C6AC>ʹ<EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
|
#define META_OPT_C2S_CONT 0x72 /*<2A><>Ƭ<EFBFBD><C6AC>ʹ<EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
|
#define META_OPT_S2C_CONT 0x73 /*<2A><>Ƭ<EFBFBD><C6AC>ʹ<EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
|
#define META_OPT_CONT_DISPOSITION 0x74 /*<2A><>Ƭ<EFBFBD><C6AC>ʹ<EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
|
#define META_OPT_SIP_DIADATA_ID 0x81 /*VOIPʹ<50><CAB9>*/
|
|
|
|
|
|
#define META_OPT_SIP_DATA_DIR 0x82
|
|
|
|
|
|
#define META_OPT_SIP_RATE_INFO 0x83
|
|
|
|
|
|
#define META_OPT_OFFSET 0x69 /*offset<65><74>ѡ<EFBFBD><D1A1>,<2C><>ǰ<EFBFBD><C7B0>һ<EFBFBD><D2BB>*/
|
|
|
|
|
|
#define META_OPT_SERVER 0x6A
|
|
|
|
|
|
|
|
|
|
|
|
/*<2A><><EFBFBD><EFBFBD><CDB8><EFBFBD><EFBFBD>ݷ<EFBFBD><DDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>*/
|
|
|
|
|
|
#define OPT_SOURCE_IP 0x41 /*localIPѡ<50><D1A1>*/
|
|
|
|
|
|
#define META_OPT_SIP_SEND_RATE_INFO 0x71 /*VOIPҵ<50><D2B5>*/
|
|
|
|
|
|
|
|
|
|
|
|
/*<2A><>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD><C2A3><EFBFBD>ƿװ<C6BF><D7B0><EFBFBD><EFBFBD><CDB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƿװ<C6BF><D7B0>ѡ<EFBFBD><D1A1>*/
|
|
|
|
|
|
#define META_OPT_INFO_BEFORE_MULTISRC 0x91 /*<2A><>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>֮ǰ<D6AE>Ľ<EFBFBD>Ŀ<EFBFBD><C4BF>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>MID<49><44>capIP<49><50><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
|
|
|
|
|
|
|
#define FILE_OSMF 0xA1
|
|
|
|
|
|
#define FILE_HLS 0xA2
|
|
|
|
|
|
#define FILE_IOS 0xA3
|
|
|
|
|
|
#define FILE_ANDRIOD 0xA4
|
|
|
|
|
|
#define FILE_APP 0xA5
|
2019-01-28 14:44:15 +08:00
|
|
|
|
#define FILE_REQ_FRAG 0xA6 /*<2A><>ƬԤ<C6AC><D4A4>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>url<72><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƫ<EFBFBD><C6AB><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD>iqiyi*/
|
2018-09-29 14:57:32 +08:00
|
|
|
|
#define FILE_MAYBE_FRAG 0xA7 /*ǰ<>˻ش<CBBB><D8B4>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƭ<EFBFBD><C6AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ*/
|
|
|
|
|
|
#define FILE_AV 0x00 /*<2A><>ƬԤ<C6AC><D4A4>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>Ϊ0x00*/
|
|
|
|
|
|
|
|
|
|
|
|
#define VOIP_UNKNOWN_MEDIA_TYPE 0xB0
|
|
|
|
|
|
|
|
|
|
|
|
/*from papp*/
|
|
|
|
|
|
#define MSG_DATA_META 0x31
|
|
|
|
|
|
#define MSG_DATA_BODY 0x32
|
|
|
|
|
|
#define MSG_DATA_TAIL 0x33
|
|
|
|
|
|
|
|
|
|
|
|
/*live*/
|
|
|
|
|
|
#define MSG_LIVE_CHECK 0x41 //from sapp
|
|
|
|
|
|
#define MSG_LIVE_RESPONS 0x42 //to sapp
|
|
|
|
|
|
|
|
|
|
|
|
/*from av_analyse*/
|
|
|
|
|
|
#define MSG_RESP_CHECKRESULT 0x11 // Check Result notification
|
|
|
|
|
|
#define MSG_RESP_REJECT 0x12 // Reject Message notification, not proc now
|
|
|
|
|
|
#define MSG_RESP_CHARACTER 0x13 // Character notification, 1. wins ack, 2. send to sapp
|
|
|
|
|
|
#define MSG_RESP_CHECKRESULT_ACK 0x14 //not send now
|
|
|
|
|
|
#define MSG_PROG_SYNC 0x15 //
|
|
|
|
|
|
|
|
|
|
|
|
/*prog sync*/
|
|
|
|
|
|
#define SYNC_SENDER_VIDEO_ANALYZER 0x01
|
|
|
|
|
|
#define SYNC_SENDER_AUDIO_ANALYZER 0x02
|
|
|
|
|
|
#define SYNC_ACTION_STOP_TO_SUBSYSTEM 0x01
|
|
|
|
|
|
#define SYNC_ACTION_STOP_TO_MAINSYSTEM 0x02
|
|
|
|
|
|
#define SYNC_ACTION_ELIMINATE_PROGRAM 0x03
|
|
|
|
|
|
|
2018-11-28 21:15:34 +08:00
|
|
|
|
/*FD<46><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƭ<EFBFBD><C6AC>GK<47><4B><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>*/
|
2018-09-29 14:57:32 +08:00
|
|
|
|
#define OPT_FRAG_ORIGIN_URL 0x11
|
|
|
|
|
|
#define OPT_FRAG_CTRL_SUBSTR 0x12
|
|
|
|
|
|
#define OPT_FRAG_INDEX_URL 0x13
|
|
|
|
|
|
|
|
|
|
|
|
/*FD<46><44><EFBFBD><EFBFBD>: ͼƬ<CDBC><C6AC><EFBFBD><EFBFBD>set opt_num=0*/
|
|
|
|
|
|
#define SURVEY_PIC_TYPE 0x31
|
|
|
|
|
|
#define SURVEY_PIC_MONITOR_TYPE 0xB1
|
|
|
|
|
|
#define SURVEY_PIC_KEYWORD_TYPE 0xB2
|
|
|
|
|
|
|
2018-12-24 18:11:20 +08:00
|
|
|
|
#define SURVER_VOIP_COLLECT_TPYE 0xA4//for K voip_collect
|
|
|
|
|
|
|
2018-11-28 21:15:34 +08:00
|
|
|
|
// FD<46><44><EFBFBD><EFBFBD>, 0<><30>ʾblacklist<73><74>1<EFBFBD><31>ʾstatic configures<65><73>2<EFBFBD><32>ʾcontent hit<69><74>
|
2018-09-29 14:57:32 +08:00
|
|
|
|
#define FD_TYPE_DYNAMIC_LIST 0
|
|
|
|
|
|
#define FD_TYPE_STATIC_CONF 1
|
|
|
|
|
|
#define FD_TYPE_ANALYSE 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*=================================monitor service===============================================*/
|
|
|
|
|
|
|
|
|
|
|
|
#define SERVICE_AUDIO_LANG 0x97 //<2F><>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2018-11-28 21:15:34 +08:00
|
|
|
|
#define SERVICE_AUDIO_LANG_FULL 0x98 //<2F><>ƴװ<C6B4><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȫ<EFBFBD>ļ<EFBFBD>JC<4A><43>־
|
2018-09-29 14:57:32 +08:00
|
|
|
|
|
|
|
|
|
|
/*=================================ack msg===============================================*/
|
|
|
|
|
|
typedef struct msg_data_ack_s
|
|
|
|
|
|
{
|
|
|
|
|
|
char prog_id[8];
|
|
|
|
|
|
uint16_t pad;
|
|
|
|
|
|
uint64_t ack_offset:48;
|
|
|
|
|
|
}msg_data_ack_t;
|
|
|
|
|
|
|
|
|
|
|
|
/*=================================data msg===============================================*/
|
|
|
|
|
|
#define MSG_HEADER_LEN sizeof(msg_header_t)
|
|
|
|
|
|
typedef struct msg_header_s
|
|
|
|
|
|
{
|
|
|
|
|
|
uint16_t magic_num;
|
|
|
|
|
|
uint8_t version;
|
|
|
|
|
|
uint8_t msg_type; // msg data type
|
|
|
|
|
|
uint32_t cont_len;
|
|
|
|
|
|
}msg_header_t; /* sizeof = 8B */
|
|
|
|
|
|
|
|
|
|
|
|
#define MSG_MEDIAINFO_HEAD_LEN (sizeof(msg_metainfo_t))
|
|
|
|
|
|
/*Data_flag defination*/
|
|
|
|
|
|
typedef struct msg_metainfo_s
|
|
|
|
|
|
{
|
|
|
|
|
|
char prog_id[8];
|
|
|
|
|
|
char flag;
|
|
|
|
|
|
#if K_PROJECT
|
|
|
|
|
|
uint8_t pad[3];
|
|
|
|
|
|
int hitservice;
|
|
|
|
|
|
uint64_t prog_len;
|
|
|
|
|
|
#else
|
|
|
|
|
|
uint8_t hitservice;
|
|
|
|
|
|
uint64_t prog_len:48;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
uint32_t cap_IP;
|
|
|
|
|
|
uint8_t protocol;
|
|
|
|
|
|
uint8_t media_type;
|
|
|
|
|
|
uint8_t data_flag;
|
|
|
|
|
|
uint8_t opt_num;
|
|
|
|
|
|
}msg_metainfo_t;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct msg_data_s
|
|
|
|
|
|
{
|
|
|
|
|
|
char prog_id[8];
|
|
|
|
|
|
union
|
|
|
|
|
|
{
|
|
|
|
|
|
struct
|
|
|
|
|
|
{
|
|
|
|
|
|
uint8_t pad;
|
|
|
|
|
|
uint8_t flags;
|
|
|
|
|
|
};
|
|
|
|
|
|
uint16_t frag_seq;
|
|
|
|
|
|
};
|
|
|
|
|
|
uint64_t offset:48;
|
|
|
|
|
|
}msg_data_t;
|
|
|
|
|
|
#define MSG_DATA_HEAD_LEN (sizeof(msg_data_t))
|
|
|
|
|
|
|
|
|
|
|
|
/*==============================response msg==================================================*/
|
|
|
|
|
|
typedef struct msg_prog_sync_s
|
|
|
|
|
|
{
|
|
|
|
|
|
char prog_id[8];
|
|
|
|
|
|
uint8_t sender; //0:reserved,1: video analyzer,2:audio analyzer
|
|
|
|
|
|
char action; //0:reserved,1:stop send to subsystem,2:stop send to main system,3:eliminate this programm
|
|
|
|
|
|
}msg_prog_sync_t;
|
|
|
|
|
|
|
|
|
|
|
|
#define MSG_RESP_CHECKRESULT_LEN (sizeof(resp_checkresult_t))
|
|
|
|
|
|
typedef struct resp_checkresult_s
|
|
|
|
|
|
{
|
|
|
|
|
|
char prog_id[8];
|
|
|
|
|
|
#if K_PROJECT
|
|
|
|
|
|
int service;
|
|
|
|
|
|
char level; //the level of check result
|
|
|
|
|
|
uint8_t opt_num; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>
|
|
|
|
|
|
uint8_t pad[6]; // Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0ֵ
|
|
|
|
|
|
#else
|
|
|
|
|
|
uint8_t service;
|
|
|
|
|
|
char level; //the level of check result
|
|
|
|
|
|
uint8_t opt_num; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>
|
|
|
|
|
|
uint8_t pad; // Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0ֵ
|
|
|
|
|
|
#endif
|
|
|
|
|
|
uint32_t cfg_id; //config ID
|
|
|
|
|
|
uint32_t file_header_size;
|
|
|
|
|
|
uint32_t file_packet_size;
|
|
|
|
|
|
}resp_checkresult_t;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct msg_log_s
|
|
|
|
|
|
{
|
|
|
|
|
|
char prog_id[8]; // program rule id;
|
|
|
|
|
|
uint32_t cfg_id; // hitted rule id;
|
|
|
|
|
|
uint32_t fount_time; // found time
|
|
|
|
|
|
uint32_t server_ip; // server ip;
|
|
|
|
|
|
uint32_t client_ip; // client ip;
|
|
|
|
|
|
uint16_t server_port; // server port;
|
|
|
|
|
|
uint16_t client_port; // client port;
|
|
|
|
|
|
uint8_t protocol; // translation protocol num;
|
|
|
|
|
|
uint8_t service; // service type;
|
|
|
|
|
|
uint8_t level; // result level;
|
2018-11-28 21:19:36 +08:00
|
|
|
|
uint8_t fd_type;
|
2018-09-29 14:57:32 +08:00
|
|
|
|
}msg_log_t;
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
|
|
{
|
|
|
|
|
|
RECV_RESP=0,
|
|
|
|
|
|
RECV_RESP_WHITELIST,
|
|
|
|
|
|
RESP_MEDIA_NOFOUND,
|
|
|
|
|
|
RESP_REPEAT,
|
|
|
|
|
|
RESP_AUDIO_LANG_MONITOR_NEW,
|
|
|
|
|
|
RESP_AUDIO_LANG_MONITOR_OLD,
|
|
|
|
|
|
RESP_SEND_BLOCK,
|
|
|
|
|
|
RESP_SEND_BLOCK_MULTI,
|
|
|
|
|
|
|
|
|
|
|
|
RECV_PROG_SYNC,
|
|
|
|
|
|
RECV_PROG_SYNC_NOFOUND,
|
|
|
|
|
|
RECV_PROG_SYNC_AUDIO_STOP,
|
|
|
|
|
|
RECV_PROG_SYNC_VIDEO_STOP,
|
|
|
|
|
|
RECV_PROG_SYNC_UNKNOW,
|
|
|
|
|
|
|
|
|
|
|
|
SEND_CONFIG_MONITOR,
|
|
|
|
|
|
SEND_LANG_MONITOR,
|
|
|
|
|
|
}RESP_LOG_TYPE;
|
|
|
|
|
|
|
|
|
|
|
|
/*VOIP <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><D6BE>ַ<EFBFBD><D6B7>ʽ*/
|
|
|
|
|
|
typedef struct layer_addr_v4_s
|
|
|
|
|
|
{
|
|
|
|
|
|
uint8_t layer_cnt;
|
|
|
|
|
|
uint8_t reserved[3];
|
|
|
|
|
|
uint32_t client_addr; /* network order, client IP */
|
|
|
|
|
|
uint32_t server_addr; /* network order, server IP */
|
|
|
|
|
|
uint16_t client_port; /* network order */
|
|
|
|
|
|
uint16_t server_port; /* network order */
|
|
|
|
|
|
}layer_addr_v4_t;
|
|
|
|
|
|
|
|
|
|
|
|
void resp_write_to_log(int type, resp_checkresult_t* check_res, void* param1, void* param2, uint64_t param3);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|