#ifndef _SS_MC_MESSAGE_H
#define _SS_MC_MESSAGE_H

#include "ss_global.h"
#include "table_structs.h"
#include "auth_msg.h"
#include "fileheaders.h"

#define MAX_DEV_NUM 64
#define MAX_USR_NAME 32
#define MAX_PTZ_ACT_DATA_LEN 1200
#define MAX_PATROL_NUM 128

typedef enum
{
	FSM_INVALID,
	FSM_UNICAST,		   
	FSM_MULCAST,
} mc_fsmType_e;

#define MAX_FSM_TYPE 3


class TMCMessager
{
public:
	U32 IP;
	U16 port;
	TMCMessager();
	~TMCMessager();
	TMCMessager(const TMCMessager &messager);
	TMCMessager(U32 nIp, U16 nPort):IP(nIp), port(nPort){};
	void operator = (const TMCMessager &messager);
	int operator<(const TMCMessager &messager) const;
	int operator==(const TMCMessager &messager) const;
	int operator!=(const TMCMessager &messager) const;
};

inline TMCMessager::TMCMessager() : IP(0), port(0)
{
}

inline TMCMessager::~TMCMessager()
{
}

inline TMCMessager::TMCMessager(const TMCMessager &messager)
{
	IP = messager.IP;
	port = messager.port;
}

inline void TMCMessager::operator = (const TMCMessager &messager)
{
	IP = messager.IP;
	port = messager.port;
}
	
inline int TMCMessager::operator<(const TMCMessager& messager) const
{
	if (IP == messager.IP)
	{
		return (port < messager.port);
	}
	else
	{
		return (IP < messager.IP); 
	}
}

inline int TMCMessager::operator==(const TMCMessager& messager) const
{
	return ((IP==messager.IP) && (port==messager.port));
}

inline int TMCMessager::operator!=(const TMCMessager& messager) const
{
	return ((IP!=messager.IP) && (port!=messager.port));
}

typedef struct 
{
	U32			reqId;
	TMCMessager  src;	/*src address to send message*/
	TMCMessager  dest;	/*dest address to receive message*/
	mc_fsmType_e   type;   /*unicast, multicast or invalid*/
	U32			Id;	 /*unicast connection Id for unicast; multicast connection Id for multicast*/
} mc_mess_head_t;

#define MC_NEED_RTP_NOT 0
#define MC_NEED_RTP_YES 1

#define MC_CONN_PATROL_NOT 0
#define MC_CONN_PATROL_YES 1

#define MC_CLI_TYPE_CLIENT	0	//监控客户端
#define MC_CLI_TYPE_MFS		1	//MFS
#define MC_CLI_TYPE_DECODER	2	//解码器
#define MC_CLI_TYPE_MC			3	//配置客户端

#define MC_SRC_TYPE_DEVICE	0
#define MC_SRC_TYPE_SERVER	1


// recording states for mc_cli_record_state_t

#define VR_RS_STORFAIL 4  // storage failure or internal error
#define VR_RS_NOSTREAM 3  // no stream
#define VR_RS_NONE	 2  // internal use only
#define VR_RS_ON	   1  // recording
#define VR_RS_OFF	  0  // not recording


// DVR operation result
#define ERR_DVR_OP_OK			   100  // 操作成功
#define ERR_DVR_OP_NO_DEV		   101  // 设备不存在
#define ERR_DVR_OP_CONN_FAILED	  102  // 设备连接失败
#define ERR_DVR_OP_FAILED		   103 // 设备连接成功，但操作失败

enum
{
	VS_STREAM_NO_0	= 0,
	VS_STREAM_NO_1	= 1,
	VS_STREAM_NO_MAX,
};

#define MEDIA_TYPE_VIDEO 0x0001
#define MEDIA_TYPE_AUDIO 0x0100
#define MEDIA_TYPE_BOTH 0x0101

typedef struct
{
	S8 devId[VS_DEV_ID_LEN];
	S8 usrName[MAX_USR_NAME];
	U32 usrPri;		//增加优先级，用于MFS根据优先级来接入/踢出用户
	U32 mediaListenIP;
	U16 mediaListenPort;
	U16 needRTP; 	//MC_NEED_RTP_NOT, MC_NEED_RTP_YES
	U32 patrolId;
	
	U16	streamNo;	//码流序号:0 ,1
	U16 nMediaType; //0x0001 视频 0x0100 音频 0x0101 音频视频

	U16	cliType;	//客户端类型:MC_CLI_TYPE_*
} cli_mc_invite_struct;
	
typedef struct
{
	U32 result;
	U32 devRecordStatus;
	U32 mulIP;
	U16 mulPort;
	S8 devId[VS_DEV_ID_LEN];
	U16 nMediaType; //0x0001 视频 0x0100 音频 0x0101 音频视频
	
	//UDP: 服务器发流端口,需要客户端向本端口打洞 
	//TCP: VSS TCP服务器端口,由Client主动连接
	U16	nMediaSendPort;		
								
	VIDEO_PARAM videoParam;//视频解码参数
	AUDIO_PARAM	audioParam;//音频解码参数
	U16 nTransPro;	//0: VS_PROTOCOL_UDP, 1: VS_PROTOCOL_TCP
} response_mc_cli_invite_struct;

//客户端请求心跳
typedef struct
{
	U32 uniConnNum;
	U32 uniConnId[MAX_DEV_NUM];
	U32 mulConnNum;
	U32 mulConnId[MAX_DEV_NUM];
	U8  patroSta[MAX_PATROL_NUM];

	S8 usrName[MAX_USR_NAME];
	U32 usrPri;		//增加优先级
	U16	cliType;	//客户端类型:MC_CLI_TYPE_*
} cli_mc_hb_struct;

//VSS MC返回结果
typedef struct
{
	U32 result;
	U32 uniConnNum;
	U32 uniConnId[MAX_DEV_NUM];
	U32 uniConnRecordStatus[MAX_DEV_NUM]; 
	U32 mulConnNum;
	U32 mulConnId[MAX_DEV_NUM];
	U32 mulConnRecordStatus[MAX_DEV_NUM];
} mc_cli_hb_struct;

typedef struct
{
	U32 result;
} response_struct;

typedef struct
{
	S8 devId[VS_DEV_ID_LEN];
	S8 usrName[MAX_USR_NAME];
	U32 usrPri;
} cli_mc_ptz_req_struct;

typedef struct
{
	U32 result;
	S8 devId[VS_DEV_ID_LEN];
} response_mc_cli_ptz_req_struct;

typedef struct
{
	S8 devId[VS_DEV_ID_LEN];
	S8 usrName[MAX_USR_NAME];
	U32 usrPri;
	
#define PTZACT_DATATYPE_VSTYPE	0
#define PTZACT_DATATYPE_XML		1
#define PTZACT_DATATYPE_HEX		2
	U32	dataType;
	U32 dataLen;
	S8 data[MAX_PTZ_ACT_DATA_LEN];
} cli_mc_ptz_act_struct;

typedef struct
{
	U32 result;
	S8 devId[VS_DEV_ID_LEN];
	U32 dataLen; 
	S8 data[MAX_PTZ_ACT_DATA_LEN]; 
} response_mc_cli_ptz_act_struct;

//对讲消息对
typedef struct
{
	S8 devId[VS_DEV_ID_LEN];
	S8 usrName[MAX_USR_NAME];
	U32 usrPri;
	U32 mediaListenIP;		//客户端收流端口
	U16 mediaListenPort;
	AUDIO_PARAM	audioParam;//客户端发送音频的解码参数
} cli_mc_audio_req_struct;

typedef struct
	{
	U32 result;
	S8 devId[VS_DEV_ID_LEN];
	
	U16	nSvrSendPort;		//服务器发流端口(通过本端口将音频发送给客户端),如果UDP则需要客户端向本端口打洞
	U16 nSvrListenPort;	//服务器收流端口(在本端口接收客户端的音频流)
	AUDIO_PARAM	audioParam;//前端发送音频的解码参数
	U16 nTransPro;	//0: VS_PROTOCOL_UDP, 1: VS_PROTOCOL_TCP
} response_mc_cli_audio_req_struct;

//关闭监控，回应使用response_t
typedef struct
{
	S8 devId[VS_DEV_ID_LEN];
	U16	streamNo;	//码流序号:0 ,1
} cli_mc_close_struct;

//广播消息对
#define MAX_BROARDCAST_DEV_NUM 20

#define VS_BROARDCAST_ALL_DEV		0	//广播到所有设备
#define VS_BROARDCAST_SPEC_DEV	1	//广播到指定设备
typedef struct
{
	U32 nBroardCastScope;	//广播范围:VS_BROARDCAST_ALL_DEV / VS_BROARDCAST_SPEC_DEV

//nBroardCastScope=VS_BROARDCAST_SPEC_DEV时,才填写以下2字段
	U32 nDevNum;		//广播设备个数,最多设备个数MAX_BROARDCAST_DEV_NUM
	S8  devId[MAX_BROARDCAST_DEV_NUM][VS_DEV_ID_LEN];
	
	S8 	usrName[MAX_USR_NAME];
	U32 usrPri;
	AUDIO_PARAM	audioParam;//客户端发送音频的解码参数

	S8	szUserId[VS_USER_ID_LEN];
	S8	szUserGrpId[VS_USERGRP_ID_LEN];
} cli_mc_audio_broadcast_req_struct;

typedef struct
{
	U32 result;
	U16 nSvrListenPort;	//服务器收流端口(在本端口接收客户端的音频流)
} response_mc_cli_audio_broadcast_req_struct;

//关闭对讲/广播，回应使用response_t
typedef struct
{
	S8 devId[VS_DEV_ID_LEN];
	S8 usrName[MAX_USR_NAME];
} cli_mc_audio_close_struct;

typedef struct
{
	U32 patrolId;
} cli_mc_patrol_req_struct;

typedef struct
{
	U32 patrolId;
} cli_mc_patrol_close_struct;

typedef struct
{
	TabDevEventInfo_t event;
} dev_event_struct;

typedef struct
{
	TabDevAlmInfo_t alarm;
} dev_alarm_struct;

#define VS_TAKEBACK_TYPE_STREAM 0
#define VS_TAKEBACK_TYPE_PTZ 1
#define VS_TAKEBACK_TYPE_AUDIO_TALK 2
#define VS_TAKEBACK_TYPE_AUDIO_BROARDCAST 3

typedef struct
{
	U32 nTakebackType; 		
	//VS_TAKEBACK_TYPE_STREAM / VS_TAKEBACK_TYPE_PTZ / VS_TAKEBACK_TYPE_AUDIO_TALK / VS_TAKEBACK_TYPE_AUDIO_BROARDCAST

	S8 devId[VS_DEV_ID_LEN]; 
	S8 grabedByUser[MAX_USR_NAME];//告知用户被何方神圣抢占
	U32 nStreamNo;	//当视频被抢占时使用
} mc_cli_takeback_struct;

typedef struct
{
	S8  devId[VS_DEV_ID_LEN];
	U32 state;   // VR_RS_XXX
	U32 uniConnNum;
	U32 uniConnId[MAX_DEV_NUM];
	U32 mulConnNum;
	U32 mulConnId[MAX_DEV_NUM];
} mc_cli_record_state_struct;

//客户端/IPC从收流端口发送到打洞消息
//MC根据devId/mediaIP/mediaPort找到原请求的连接，重新转发到socket对应的IP和端口
const unsigned int VS_NAT_MAGIC = 0x69707673; //"ipvs" 

#define VS_HOLE_SENDOR_CLIENT	0	//客户端打洞(用于监控、对讲)
#define VS_HOLE_SENDOR_IPC	1	//IPC打洞(用于对讲/广播)

#define VS_HOLE_FOR_STREAM	0	//用于监控
#define VS_HOLE_FOR_TALK		1	//用于对讲
typedef struct{
	U32 magic;		//VS_NAT_MAGIC
	S8 	devId[VS_DEV_ID_LEN];
	U32 nHoleSendor;	//VS_HOLE_SENDOR_CLIENT / VS_HOLE_SENDOR_IPC
	U32 nHolePurpose;	//VS_HOLE_FOR_STREAM / VS_HOLE_FOR_TALK
	U32 mediaIP;	//原请求的收流IP
	U16 mediaPort;	//原请求的收流端口
	U16 reserved;
	U32 nSvrInst;	//Server instance ID
} cli_mc_open_hole_struct;


///////////CTM相关//////////////////////////////
typedef vs_time_t dvr_record_time_t;
typedef content_timeinfo_t dvr_record_info_t;

typedef enum enumMediaType
{
	MEDIA_TYPE_AV = 1,
	MEDIA_TYPE_JEPG = 2,
	MEDIA_TYPE_VV = 4,
	MEDIA_TYPE_ALL = 7,
}MediaType_e;


typedef enum enumRecordType
{
   RECORD_TYPE_SCHEDULE = 1,
   RECORD_TYPE_IO = 2,
   RECORD_TYPE_MOTION_DETECT = 4,
   RECORD_TYPE_ALL = 7,
}RecordType_e;

typedef enum enumStreamType
{
	STREAM_TYPE_CIF = 1,
	STREAM_TYPE_D1  =2,
	STREAM_TYPE_ALL = 3,
}StreamType_e;


#define PLATFORM_RECORD_TYPE_SCHEDULE 1
#define PLATFORM_RECORD_TYPE_ALARM 2
#define PLATFORM_RECORD_TYPE_ALL  3


//CTM消息公共头
typedef struct
{
	S8 userID[VS_USER_ID_LEN];
	S32 sessionID;
	S32 reqID;
}ctm_common_head_struct;

//通用CTM回应消息
typedef struct
{
	ctm_common_head_struct commonHead;
	U32 retCode;		// see constants prefixed CM_ERR_
}response_ctm_result_struct;


//内容查询请求
typedef struct
{
	ctm_common_head_struct  commonHead;
	U32	recordType;   // see PLATFORM_RECORD_TYPE_*
	S8  szDevId[VS_DEV_ID_LEN];
	U32 nPageNum;	//从0开始
	content_timeinfo_t time_info;
}content_platform_query_struct;

typedef struct 
{
	ctm_common_head_struct  commonHead;
	S8  szDevId[VS_DEV_ID_LEN];
	U32 mediaType;
	U32 recordType;
	U32 streamType;	
	U32 nPageNum;	//从0开始
	content_timeinfo_t time_info;
}content_alarmup_query_struct;

typedef struct 
{
	ctm_common_head_struct  commonHead;
	S8  szDevId[VS_DEV_ID_LEN];
	U32 mediaType;
	U32 recordType;
	U32 streamType;
	U32 nPageNum;	//从0开始
	content_timeinfo_t time_info;
}content_dvr_query_struct;

//内容查询回应
typedef struct
{
	ctm_common_head_struct  commonHead;
	U32 retCode;		// see constants prefixed CM_ERR_
	S8  szDevId[VS_DEV_ID_LEN];
	U16	nTotalNum;		//总记录数
	U16 nRecordNum;	//本次记录个数
	content_fileinfo_t file_info[VS_CONTENT_PAGE_SIZE];
}response_content_query_struct;

//内容下载,一次只允许一个文件
typedef struct
{
	ctm_common_head_struct  commonHead;
	S8 szDevId[VS_DEV_ID_LEN];
	S8 szFilePath[VS_FILE_PATH_LEN];	// 查询时CTM返回的文件路径
}content_export_struct;


typedef struct 
{
	ctm_common_head_struct  commonHead;
	S8 szDevId[VS_DEV_ID_LEN];
	S8 szFilePath[VS_FILE_PATH_LEN];  // 查询时CTM返回的文件路径
	S8 szFtpPath[VS_FILE_PATH_LEN];	//IPC 文件上传FTP 路径
	S8 szFtpUsrName[VS_FTP_USER_NAME_LEN];	//IPC 文件上传FTP 用户名
	S8 szFtpUsrPwd[VS_FTP_PASSWD_LEN];//IPC 文件上传FTP 密码
}content_dvr_export_struct;

typedef struct
{
	ctm_common_head_struct  commonHead;
	U32 retCode;// see constants prefixed CM_ERR_
	S8 szDevId[VS_DEV_ID_LEN];
	S8 szFilePath[VS_FILE_PATH_LEN];//指示客户端下载的FTP路径
	S8 szFtpUsrName[VS_FTP_USER_NAME_LEN];	//下载文件所用的临时分配的用户名
	S8 szFtpUsrPwd[VS_FTP_USER_NAME_LEN];
} response_content_export_struct;

//内容删除,一次只允许一个文件
typedef struct
{
	ctm_common_head_struct  commonHead;
	S8 szDevId[VS_DEV_ID_LEN];
	S8 szFilePath[VS_FILE_PATH_LEN];	// 查询时CTM返回的文件路径
}content_delete_struct;

//内容保护,一次只允许一个文件
typedef struct
{
	ctm_common_head_struct  commonHead;
	S8 szDevId[VS_DEV_ID_LEN];
	S8 szFilePath[VS_FILE_PATH_LEN];	// 查询时CTM返回的文件路径
	S32  action;		  //action = 0  去保护, action = 1 保护
}content_protect_struct;


//查询一天内录像情况请求
typedef struct
{
	ctm_common_head_struct  commonHead;
	S8  szDevId[VS_DEV_ID_LEN];
	vs_time_t date;	//年月日有效
}content_platform_distribute_query_struct;

#define VS_RECORD_DISTRIBUTE_LEN			1440	//一天24小时 * 60分钟
//#define VS_REC_TYPE_UNCONDITIONAL 'A'  // unconditional recording
//#define VS_REC_TYPE_DRIVEN		'B'  // event/alarm-driven recording
//#define VS_REC_TYPE_NO_RECORDING  'C'  // no recording
typedef struct
{
	ctm_common_head_struct  commonHead;
	U32 retCode;// see constants prefixed CM_ERR_
	S8 szDevId[VS_DEV_ID_LEN];
	vs_time_t date;	//年月日有效
	S8 szRecordDistribution[VS_RECORD_DISTRIBUTE_LEN+4];//指示客户端一天内录像分布
} response_content_platform_distribute_query_struct;
//说明: szRecordDistribution字符串指示1天内(24小时*60分钟)具体到每分钟的录像分布情况
//字符A表示有计划录像,B表示告警录像,C表示无录像,详见device_info.h

//下载请求时间段内录像内容请求
typedef struct
{
	ctm_common_head_struct  commonHead;
	S8 szDevId[VS_DEV_ID_LEN];
	content_timeinfo_t time_info;	//下载时间段，不能超过5分钟
}content_export_specifictime_struct;

typedef struct
{
	ctm_common_head_struct  commonHead;
	U32 retCode;// see constants prefixed CM_ERR_
	S8 szDevId[VS_DEV_ID_LEN];
	S8 szFilePath[VS_FILE_PATH_LEN];//指示客户端下载的FTP路径
	S8 szFtpUsrName[VS_FTP_USER_NAME_LEN];	//下载文件所用的临时分配的用户名
	S8 szFtpUsrPwd[VS_FTP_USER_NAME_LEN];
} response_content_export_specifictime_struct;


//客户端主动取消前端录像文件下载
typedef struct
{
	ctm_common_head_struct  commonHead;
	S8 szDevId[VS_DEV_ID_LEN];
	S8 szFilePath[VS_FILE_PATH_LEN];	// IPC前端录像文件名
}cancel_content_export_struct;

//回应消息:客户端主动取消前端录像文件下载
typedef struct
{
	ctm_common_head_struct  commonHead;
	U32 retCode;// see constants prefixed CM_ERR_
	S8 szDevId[VS_DEV_ID_LEN];
	S8 szFilePath[VS_FILE_PATH_LEN];	// IPC前端录像文件名
}response_cancel_content_export_struct;

//通知客户端前端文件上载失败(客户端请求下载前端录像文件后，等待下载过程中)
typedef struct
{
	ctm_common_head_struct  commonHead;
	S8 szDevId[VS_DEV_ID_LEN];
	S8 szFilePath[VS_FILE_PATH_LEN];	// IPC前端录像文件上载后的路径
}notify_content_ipcupload_failed_struct;


//通知客户端下载文件
typedef struct
{
	ctm_common_head_struct  commonHead;
	S8 szDevId[VS_DEV_ID_LEN];
	S8 szFilePath[VS_FILE_PATH_LEN];	// IPC前端录像文件上载后的路径
}notify_content_ipcupload_successed_struct;

//将前端文件上载进度通知到客户端
typedef struct
{
	ctm_common_head_struct  commonHead;
	S8 szDevId[VS_DEV_ID_LEN];
	S8 szFilePath[VS_FILE_PATH_LEN];	// IPC前端录像文件名
	U32 nProgress;	//上载进度，0-100
}notify_content_ipcupload_progress;


typedef struct
{
	ctm_common_head_struct  commonHead;
	S8 szDevId[VS_DEV_ID_LEN];
	S8 szFilePath[VS_FILE_PATH_LEN];	// IPC前端录像文件名
}notify_ipcupload_successed_struct;


typedef struct
{
	ctm_common_head_struct  commonHead;
	U32 retCode;
	S8 szDevId[VS_DEV_ID_LEN];
	S8 szFilePath[VS_FILE_PATH_LEN];	// IPC前端录像文件名
	S8 szFtpUsrName[VS_FTP_USER_NAME_LEN];	//下载文件所用的临时分配的用户名
	S8 szFtpUsrPwd[VS_FTP_PASSWD_LEN];
}notify_client_download_struct;

//获取/修改服务器IP地址
typedef struct 
{
	U32 result;
	vs_get_systemip_cfg data;
}vss_get_systemip_cfg;

typedef struct
{
	vs_set_systemip_cfg data;
}vss_set_systemip_cfg;


typedef struct 
{
	S8 szPassword[VS_STRING_LENG_32];
}vss_setsystem_password;



//#define VS_CTL_SYSTEM_SHUTDOWN_SERVER	1
//#define VS_CTL_SYSTEM_REBOOT_SERVER	2
//#define VS_CTL_SYSTEM_REBOOT_NE	3
//操作服务器系统
typedef struct 
{
	U32 nControlSystemType;	//se define in vms
}vss_systemctl_struct;


typedef struct
{
	S8 usrName[MAX_USR_NAME];
}vss_autoadd_storagepath_struct;

typedef struct
{
	U32 result;
	vss_systemctl_struct data;
}vss_systemctl_response;

typedef union
{
	cli_mc_invite_struct					cli_mc_invite_t;
	response_mc_cli_invite_struct			response_mc_cli_invite_t;
	
	cli_mc_hb_struct						cli_mc_hb_t;		//客户端发送给MC的心跳请求
	mc_cli_hb_struct						mc_cli_hb_t;		//MC发送给客户端的心跳回应
	
	cli_mc_ptz_req_struct					cli_mc_ptz_req_t;
	response_mc_cli_ptz_req_struct	  		response_mc_cli_ptz_req_t;
	
	cli_mc_ptz_act_struct					cli_mc_ptz_act_t;	
	response_mc_cli_ptz_act_struct	  		response_mc_cli_ptz_act_t;
	
	cli_mc_audio_req_struct			  		cli_mc_audio_req_t;
	response_mc_cli_audio_req_struct		response_mc_cli_audio_req_t;
	
	cli_mc_audio_broadcast_req_struct	 	cli_mc_audio_broadcast_req_t;
	response_mc_cli_audio_broadcast_req_struct	response_mc_cli_broardcast_req_t;
		
	cli_mc_close_struct						cli_mc_close_t;
	cli_mc_audio_close_struct				cli_mc_audio_close_t;
	cli_mc_patrol_req_struct				cli_mc_patrol_req_t;
	cli_mc_patrol_close_struct		  		cli_mc_patrol_close_t;
	
	response_struct					  		response_t;	
	
	dev_event_struct						dev_event_t;	
	dev_alarm_struct						dev_alarm_t;
	mc_cli_takeback_struct		  			mc_cli_takeback_t;
	mc_cli_record_state_struct		  		mc_cli_record_state_t;


	//平台录像
	content_platform_query_struct content_query_t;
	response_content_query_struct response_content_query_t;
	
	content_export_struct content_export_t;//如有多个文件,则多次请求
	response_content_export_struct response_content_export_t;

	content_delete_struct	content_delete_t;
	response_ctm_result_struct response_content_delete_t;

	content_protect_struct	content_protect_t;
	response_ctm_result_struct response_content_protect_t;

	content_platform_distribute_query_struct content_distribute_query_t;//查询一天内录像情况请求
	response_content_platform_distribute_query_struct response_content_distribute_query_t;

	content_export_specifictime_struct	content_sepcifictime_export_t;	//下载请求时间段内录像内容请求
	response_content_export_specifictime_struct response_content_sepcifictime_export_t;


	//告警上传录像的管理
	content_alarmup_query_struct alarmup_content_query_t;
	response_content_query_struct response_alarmup_content_query_t;
	
	content_export_struct alarmup_content_export_t;//如有多个文件,则多次请求
	response_content_export_struct response_alarmup_content_export_t;

	content_delete_struct	alarmup_content_delete_t;
	response_ctm_result_struct response_alarmup_content_delete_t;

	content_protect_struct	alarmup_content_protect_t;
	response_ctm_result_struct response_alarmup_content_protect_t;
	
	//前端录像
	//查询前端录像
	content_dvr_query_struct dvr_content_query_t;
	response_content_query_struct response_dvr_content_query_t;

	//删除前端录像
	content_delete_struct	dvr_content_delete_t;	
	response_ctm_result_struct response_dvr_content_delete_t;

	//客户端通知平台下载前端录像
	content_export_struct dvr_content_export_t;//如有多个文件,则多次请求
   // 平台通知前端下载前端录像
	content_dvr_export_struct  dvr_content_download_t;   

	response_ctm_result_struct response_dvr_content_export_t;


	
	
	//客户端主动取消下载前端文件
	cancel_content_export_struct	dvr_cancel_content_export_t;	
	response_cancel_content_export_struct	response_dvr_cancel_content_export_t;

	//通知客户端IPC上载文件失败
	notify_content_ipcupload_failed_struct dvr_content_ipc_upload_failed_t;	
	//通知客户端IPC上载文件进度
	notify_content_ipcupload_progress	dvr_content_ipc_upload_progress_t;

	//ipc 通知平台上载文件成功
	notify_ipcupload_successed_struct dvr_content_upload_successed_notify_t;

	//平台通知客户端下载前端文件
	notify_client_download_struct   dvr_content_download_notify_t;


	//客户端通知VSS/MFS配置更改
	cli_notify_cfgchange_struct cfgchange_notify_t;
	cli_notify_cfgchange_rsp cfgchange_rsp_t;

	//VMS通知VSS camera注册信息更改
	auth_camera_reginfo		camRegInfo_notify_t;

	//获取/设置系统IP
	vss_get_systemip_cfg	getsystemip_t;
	vss_set_systemip_cfg	setsystemip_t;
	vss_systemctl_struct sysctl_t;
	vss_systemctl_response sysctl_rsp;
	vss_setsystem_password setsyspwd_t;
	vss_autoadd_storagepath_struct autoaddpath_t;
} mc_mess_body_u;

typedef struct mc_mess
{
	MSMsgHead_t m_commHead;
	mc_mess_head_t m_mcHead;
	mc_mess_body_u m_mcBody;	
} mc_mess_t;

//使用zlib压缩时，只压缩mc_mess_body_u结构，前面2个消息头不压缩,可使用如下结构来读取消息头
typedef struct vss_mess_head
{
	MSMsgHead_t m_commHead;
	mc_mess_head_t m_mcHead;
} vss_mess_head_t;


	
/*
 * UTS Common voice packet header 
 */
const U32 AUDSTRMMAGIC = 0x41554453;  
typedef struct AudioStreamHeader_s
{
	U32 magic;		  /* AUDSTRMMAGIC = "AUDS" */
	U32 vendor;		 /* refer to device_info.h */
	U32 length;		 /* packet length (header+payload) */
}AudioStreamHeader_t;

#define VS_CLI_ALMACT_USRNAME		"vs_client_alarm_act"
#endif
