diff options
Diffstat (limited to 'src/inc_soq/AV_entry.h')
| -rw-r--r-- | src/inc_soq/AV_entry.h | 347 |
1 files changed, 347 insertions, 0 deletions
diff --git a/src/inc_soq/AV_entry.h b/src/inc_soq/AV_entry.h new file mode 100644 index 0000000..66f524a --- /dev/null +++ b/src/inc_soq/AV_entry.h @@ -0,0 +1,347 @@ +/* +* Copyright (c) 2014 +* MESA Group,Institute of Information Engineering, Chinese Academy of Sciences. +* All rights reserved. +* +* Authors: Zheng Chao ([email protected]) +* +* Version: v2.0 April 5, 2014 (ZhengChao) +*/ + + +#ifndef _AVENTRY_H_ +#define _AVENTRY_H_ +#ifndef __cplusplus +#error("This file should be compiled with C++ compiler") +#endif +#include "KafkaProducer.h" +#include "AV_types.h" +#include <MESA/field_stat2.h> +#include <MESA/wiredLB.h> + +#include <stdio.h> +#ifdef __cplusplus +extern "C" { +#endif + +#define MAX_LOCATION_NUM 2 +#define MAX_PER_LOC_BIZMAN 4 +#define MAX_AV_DST_TYPE 5 + + +struct tdIP +{ + unsigned int ip; + unsigned int location;//0: backend,1:frontend; +}; + + +typedef struct _FBOption +{ + char user_tag[128]; + int wlb_override; + char location_type; + char uiAvDstFunc[13]; + unsigned short data_port; + int wlb_primary_ip_num[MAX_LOCATION_NUM]; + int wlb_secondary_ip_num[MAX_LOCATION_NUM]; + unsigned short wlb_health_port[MAX_LOCATION_NUM]; + WLB_handle_t wlb_handle[MAX_LOCATION_NUM]; + char wlb_group[MAX_LOCATION_NUM][256]; + char wlb_primary_ip[MAX_LOCATION_NUM][512]; + char wlb_secondary_ip[MAX_LOCATION_NUM][512]; + struct WLB_consumer_t wlb_cons[MAX_LOCATION_NUM][32]; +}FBOption_t; + +#define av_module_name "AV_Module" +#define voip_module_name "VOIP_Module" + + + + +typedef struct _stTVGlobalOption { + + // For AV Data SendBack Setting + char sSendDev[10]; // �ش��豸���� + unsigned short uiBSendPortNum[MAX_AV_DST_TYPE]; // �ش��˿ڸ��� + unsigned short iBIPMode[MAX_AV_DST_TYPE]; // �ش�ģʽ���� + unsigned int iBSendIPNum[MAX_AV_DST_TYPE]; // �ش���˻����� + tdIP *aiBSendIP[MAX_AV_DST_TYPE]; //�ش� IP �б� + unsigned short uiBSendPort[MAX_AV_DST_TYPE]; // �ش��˿� + unsigned short DupSendMod; //���Ʒ���ģʽ�������� + unsigned short threshold; + unsigned short expire_after; + unsigned int DupSendMetaSwitch; + + unsigned int iSendLogModeSwitch; + unsigned int iUdpSendLogIPNum; + unsigned int iUdpSendLogIP; + unsigned short iUdpSendLogPort; + + unsigned short iImageAnalyseIPMode; + unsigned int iImageAnalyseIPNum; + tdIP *aiImageAnalyseServer; + unsigned short uiImageAnalyseSendPort; + unsigned short uiImageAnalyseSendPortNum; + + unsigned short iAppAnalyseIPMode; + unsigned int iAppAnalyseIPNum; + tdIP *aiAppAnalyseServer; + unsigned short uiAppAnalyseSendPort; + unsigned short uiAppAnalyseSendPortNum; + + unsigned int iHdIPNum[MAX_AV_DST_TYPE]; // ��˻����� + tdIP *aiHdIP[MAX_AV_DST_TYPE]; // ��� IP �б� + unsigned int iLogHdstat[MAX_AV_DST_TYPE]; //��¼���״̬ + // For Local server port; + unsigned short uiResultReceivePort; // �������շ�������Ķ˿ں� + + // For Configure and Log Server Setting + char sLogServer[128]; // ����Ƶ��־������IP + unsigned short iLogPort; // ����Ƶ��־�������˿� + + unsigned int sLogVoipServer; // ����ƵVOIP��־������IP + unsigned short iLogVoipPort; // ����ƵVOIP��־�������˿� + + char table_info_path[256]; + char inc_cfg_dir[256]; + char full_cfg_dir[256]; + char backup_cfg_dir[256]; + + char voip_table_info_path[256]; + char voip_inc_cfg_dir[256]; + char voip_full_cfg_dir[256]; + + char global_dynamic_rule_table_info_path[256]; + char local_dynamic_rule_table_info_path[256]; + char global_dynamic_rule_redis_ip[256]; + char local_dynamic_rule_redis_ip[256]; + unsigned short global_dynamic_rule_redis_port_num; + unsigned short global_dynamic_rule_redis_port; + unsigned short local_dynamic_rule_redis_port; + unsigned short dynlist_listen_port; + + // For Hash List size + unsigned int uiDynamicBWSize; // ��̬����/������������С + unsigned int uiDynamicB_ExpireTime; // ��̬��������ʧЧʱ�� + unsigned int uiDynamicW_ExpireTime; // ��̬����������ʧЧʱ�� + unsigned int uiTVListSize; // ��Ŀ��������С + + // Switch for debug Setting + unsigned short iLog_SendBack_Data; // �ش�������־��¼���� + unsigned short iLog_Found_Prog; // ���ֵĽ�ĿURL��־��¼���� + unsigned short iLog_Fendu_Msg_Act; // FD��Ϣ�Ͷ�����־��¼���� + unsigned short iLog_Config; // ���ý��ܹ�����־��¼���� + unsigned short uiSw_Store_Stream; // �����ݴ洢��־��¼���� + unsigned short iSendMetaLog; // ��¼���ͽ�ĿԪ��Ϣ��ͷ���Ŀ��� + + + + unsigned int uiLogMsgLocal; // �����Ƿ�洢��ǰ�˻����� + unsigned int uiLogFileSize; // �洢�ļ����� + unsigned int uiNetlogSwitch; //asmis log switch + + unsigned short iLog_Found_BtProg; // ʶ���bt��Ŀ + unsigned short iLog_Found_BtInfo; // bt��Ϣ + unsigned short iStaticsLog; // ͳ����־���ؼ�¼���� + unsigned short iStaticsLogZip; // ͳ����־�Ƿ����ѹ������ + + unsigned int uiJsonRuleSwitch; + unsigned int uiFengDu; + unsigned int uiConnBlklistSwitch; // do 3 tuple black list switch + unsigned int uiMinImageSize; + unsigned int uiMaxImageSize; + //add by lqy 20110329 + unsigned int uiLenLimited; + unsigned int uiMinAvSize; + unsigned int uiMaxAvSize; + + unsigned int uiClientIP; // + unsigned int uiLocalIP; // localip; + unsigned int uiDoSendData; // wheather send data ? + unsigned int uiRawSendData; //raw Send Data Switch + unsigned int uiPagSendData; //pag Send Data Switch + unsigned int uiLoopSendData; // loop Send Data Switch + unsigned int uiLockSwitch; // lock Switch + unsigned int uiAckSendData; //ack av data switch + unsigned int uiAVDataMaxLen; + unsigned int uiAckListenPort; // ack listern port + unsigned int uiAckQueueSize; // ack retransmit queue + unsigned int uiAckTimeout; // ack time-out + unsigned int uiAckThreshold; // bytes that required ack in the front of a program + unsigned int uiTvQueueSize; //tv datasize + unsigned int uiBizmanMaxResendTimes;//5 times as default + unsigned int uiBizmanResendTimeBaseMiliSeconds;//500ms as default + unsigned int uiBizmanStreamFrozenMiliSeconds;//30000ms as default + unsigned int uiBizmanSendSmoothMiliSeconds; + unsigned int uiBizmanCacheSmoothPktsLimit; + unsigned int local_dynhash_timeout; + unsigned int BlockWhitehashTimeout; + unsigned int log_accumulate_timeout; + unsigned int log_max_accumulate_cnt; + unsigned int voip_switch; + unsigned int prog_trans_kafka_switch; + unsigned int fd_type2_kafka_switch; + unsigned int redis_switch; + char log_acc_service_type[1024]; + unsigned int stat_cycle; + unsigned int screen_print_switch; + + FBOption_t fbOption[MAX_AV_DST_TYPE]; + + unsigned int local_ip_nr; + unsigned int log_local_msg; + char local_ip_str[128]; + char log_local_msg_path[128]; + char prog_trans_kafka_brokers[1024]; + char fd_type2_kafka_brokers[1024]; + KafkaProducer *prog_trans_kafka_producer; + + char fs2_ip[32]; + unsigned short fs2_port; +}tdAVOption; +#define AV_STAT_FIELD_MAX_NUM 60 +#define AV_STAT_FIELD_PROG_CNT 0 +#define AV_STAT_FIELD_SND_BYTS 1 +#define AV_STAT_FIELD_SND_PKTS 2 +#define AV_STAT_FIELD_SND_ERR 3 +#define AV_STAT_FIELD_RESORT_BYTS 4 +#define AV_STAT_FIELD_RESORT_PKTS 5 +#define AV_STAT_FIELD_SURVEY_CNT 6 +#define AV_STAT_FIELD_DEDUP_BYTS 7 +#define AV_STAT_FIELD_DEDUP_PKTS 8 +#define AV_STAT_FIELD_PRE_ACK 9 +#define AV_STAT_FIELD_LOG_CNT 10 +#define AV_STAT_FIELD_IMAGE_BYTS 11 +#define AV_STAT_FIELD_IMAGE_PKTS 12 +#define AV_STAT_FIELD_IMAGE_CNT 13 +#define AV_STAT_FIELD_ADD_ACC 14 +#define AV_STAT_FIELD_DEL_ACC 15 +#define AV_STAT_FIELD_ADD_TRANSF 16 +#define AV_STAT_FIELD_DEL_TRANSF 17 +#define AV_STAT_FIELD_READ_TRANSF 18 +#define AV_STAT_FIELD_APP_BYTS 19 +#define AV_STAT_FIELD_APP_PKTS 20 +#define AV_STAT_FIELD_APP_CNT 21 +#define AV_STAT_FIELD_FRAG_BYTS 22 +#define AV_STAT_FIELD_FRAG_PKTS 23 +#define AV_STAT_FIELD_FRAG_CNT 24 +#define AV_STAT_FIELD_KFA_SEND_NUM 25 +#define AV_STAT_FIELD_KFA_SEND_BYTS 26 +#define AV_STAT_FIELD_KFA_DROP_NUM 27 +#define AV_STAT_FIELD_KFA_DROP_BYTS 28 +#define AV_STAT_FIELD_VOIP_BYTS 29 +#define AV_STAT_FIELD_VOIP_PKTS 30 +#define AV_STAT_FIELD_VOIP_CNT 31 +#define AV_STAT_FIELD_KFA_FD2_NUM 32 +#define AV_STAT_FIELD_KFA_FD2_BYTS 33 +#define AV_STAT_FIELD_KFA_DROP_FD2_NUM 34 +#define AV_STAT_FIELD_KFA_DROP_FD2_BYTS 35 +#define AV_STAT_FIELD_SAPP_BYTES 36 +#define AV_STAT_FIELD_SAPP_PKTS 37 +#define AV_STAT_FIELD_HIT_DYN_IP 38 +#define AV_STAT_FIELD_SIP_SIG_NUM 39 +#define AV_STAT_FIELD_VOIP_LOG_CNT 40 +#define AV_STAT_FIELD_SEV17_LOG 41 +#define AV_STAT_FIELD_SEV35_LOG 42 +#define AV_STAT_FIELD_SEV17_SURVEY 43 +#define AV_STAT_FIELD_SEV35_SURVEY 44 +#define AV_STAT_FIELD_RTP_CODING_KNOWN_NUM 45 +#define AV_STAT_FIELD_RTP_CODING_KNOWN_BYTS 46 +#define AV_STAT_FIELD_IDENTIFY_AV_DUP_PROG 47 +#define AV_STAT_FIELD_IDENTIFY_AV_DUP_PKTS 48 +#define AV_STAT_FIELD_IDENTIFY_AV_DUP_BYTS 49 +#define AV_STAT_FIELD_HUD_S 50 +#define AV_STAT_FIELD_HUD_D 51 +#define AV_STAT_FIELD_CM_CNT 52 +#define AV_STAT_FIELD_FRAG_IDX_CNT 53 +#define AV_STAT_FIELD_CM_302_CNT 54 +#define AV_STAT_FIELD_CM_GUMBO_IN_CNT 55 +#define AV_STAT_FIELD_CM_GUMBO_OUT_CNT 56 +#define AV_STAT_FIELD_CM_URL_CNT 57 +#define AV_STAT_FIELD_ALL_LOG_REFER 58 +#define AV_STAT_FIELD_FD2_LOG_REFER 59 + + + + + + + + +typedef struct +{ + unsigned long long id; + const char *str; +}fs2_str_contrast_id_t; + + +typedef struct _av_stat_t +{ + unsigned long proto_bytes[AV_PROTOCOL_MAX_NUM]; + unsigned long proto_pkts[AV_PROTOCOL_MAX_NUM]; + unsigned long prog_cnt; + unsigned long bytes; + unsigned long pkts; + unsigned long send_err; + unsigned long resort_bytes; + unsigned long resort_pkts; + unsigned long image_bytes; + unsigned long image_pkts; + unsigned long image_cnt; + unsigned long survey_cnt; + unsigned long avsendpkt; + unsigned long av_dedup_bytes; + unsigned long av_dedup_pkt; + unsigned long avpreacknum; + unsigned long log_cnt; + unsigned long add_transf; + unsigned long del_transf; + unsigned long read_transf; + unsigned long add_acc; + unsigned long del_acc; + unsigned long app_bytes; + unsigned long app_pkts; + unsigned long app_cnt; + unsigned long frag_bytes; + unsigned long frag_pkts; + unsigned long frag_cnt; + unsigned long voip_bytes; + unsigned long voip_pkts; + unsigned long voip_cnt; + int fs_id[AV_STAT_FIELD_MAX_NUM]; +}AV_stat_t; + +extern tdAVOption g_AVOption; +extern AV_stat_t g_AVStat; +extern int g_iAVSwitch; +extern void *g_av_logger; +extern void *g_img_fp_scanner; +extern unsigned int g_AV_CurrentTime; +extern unsigned int g_thread_num; +extern KafkaProducer *g_multi_kafka_producer; +extern screen_stat_handle_t g_av_stat_handle; +extern screen_stat_handle_t g_AV_scan_feather; +extern screen_stat_handle_t g_VOIP_scan_feather; +extern screen_stat_handle_t g_AV_global_feather; + + + +void net_log_ysp_info(int interval,unsigned long long *inputinfo,unsigned long long *outputinfo); +int avchecklogip(const struct layer_addr* paddr); + +extern FILE * g_BlockMsgfd; +extern FILE * g_BlockActionfd; +extern FILE * g_SndBackfd[MAX_THREAD_NUM]; +extern FILE * g_fp_logprog; +extern FILE * g_rtspfd; +extern FILE * g_Configfd; +extern FILE * g_Staticsfd; +extern FILE * g_SendMetafd; +extern FILE * g_DropRate; + +void WriteLocalLog(FILE * fp,const char *fmt,...); +#ifdef __cplusplus +} +#endif +#endif |
