/**----------------------------------------------------------------------
** Copyright	: Video Surveillance(China) Co. Ltd 2006-20007
** File Name	: err_code.h
** Description  : system error code definition
**				
** Created On   : 
** Created by   : 
** Modification : 
** 
**---------------------------------------------------------------------*/
#ifndef __ERR_CODE_HEADER__
#define __ERR_CODE_HEADER__


#define VS_ERR_COMM_BASE		0x1001//通讯错误
#define VS_ERR_DB_BASE			0X2001//数据库错误
#define VS_ERR_AD_BASE			0X3001
#define VS_ERR_CTM_BASE   		0x4001
#define VS_ERR_SS_MC_BASE	 0x5001		/*Main controller*/
#define VS_ERR_SS_VR_BASE	 0x6001		/*Video Recorder*/
#define VS_ERR_SS_NT_BASE	 0x7001		/*Network transmitter*/
#define VS_ERR_SM_SC_BASE	 0x8001		/*Session Controller*/
#define VS_ERR_SM_RTSP_BASE   0x9001		/*RTSP stack*/
#define VS_ERR_SM_CE_BASE	 0x1001		/*Content Engine*/
#define VS_ERR_CLI_BASE	   0x1101
#define VS_ERR_VMS_BASE	   0x1201
#define VS_ERR_AUTH_BASE		0X1301

enum
{
	ERR_OK = 0,

//common error code
	ERR_NOT_INITIAL=VS_ERR_COMM_BASE,	//Object has not been initialized
	ERR_INITIAL_FAIL,	 //Object initial fail
	ERR_INVALID_PARAM,	 //invalid parameter
	ERR_INVALID_OBJ,	   //Invalid object
	ERR_INVALID_OPR,	   //invalid operation
	ERR_OUT_OF_MEMORY,	 //Out of memory or can't allocate resource
	ERR_OBJ_NOT_FOUND,	 //Search one object, but not found
	ERR_OBJ_EXISTED,	   //Insert one object, but existed
	ERR_ALLOC_NODE,		//allocate node error because all nodes are busy
	ERR_INVOKE_SSI,	   
	ERR_INVOKE_DB,		
	ERR_INVOKE_MD,		
	ERR_RECV_FROM,		
	ERR_SEND_TO,		  
	ERR_BADMSG,		   
	ERR_REQID_NOT_FOUND,  
	ERR_DUP_OPR,		  
	ERR_VERSION_MISMATCH, 
	ERR_UNCOMPRESS_FAILED,	//解压失败
	ERR_COMPRESS_FAILED,		//压缩失败
	ERR_OTHER,			

//db error code
	ERR_TAB_EXIST_ALREADY=VS_ERR_DB_BASE,
	ERR_TAB_NOT_EXIST,		   
	ERR_RECORD_EXIST_ALREADY,	 
	ERR_RECORD_NOT_EXIST,		 
	ERR_COL_NOT_EXIST,			
	ERR_DB_OP_FAIL,			   
	ERR_MSG_EXCEED_BUF,		   


//connMgr error code
	ERR_CONN_TYPE_NOT_FOUND=VS_ERR_SS_MC_BASE,
	ERR_CONN_ID_NOT_FOUND,  
	ERR_FSM_FUNC_NOT_FOUND,	
	ERR_KILL_FSM,			  
	ERR_CONN_EXISTED, 
	ERR_NOT_SURPPORT_DOUBLE_STREAM,
	ERR_NOT_SURPPORT_PTZ,
	ERR_NOT_SURPPORT_AUDIOIN,
	ERR_NOT_SURPPORT_AUDIOOUT,
	ERR_DEV_PROFILE_NOT_FOUND,  /*0x500A	this device profile not found*/
	ERR_WATCHER_NOT_FOUND,	//Watcher找不到
	ERR_DEV_NOTGETIP_FROM_WWWNAME,	//根据WWW域名获取IP错误
	ERR_NOTIFY_VMC,
	ERR_EXCEED_MAX_DEV,		//该客户端超过最大监控设备数量
	ERR_EXCEED_MAX_BAND,		//MFS接入子网带宽超过限制
	ERR_ALLOC_WATCHER_ID,	/*0x5010*/
	ERR_ALLOC_DEVICE_ID,
	ERR_ALLOC_UNIICONN_ID,
	ERR_ALLOC_MULTICONN_ID,
	ERR_ALLOC_STREAM_PORT,
	ERR_REQ_AD,		//向AD发送请求失败
	ERR_AD_RETURN_ERROR, //AD回应失败
	ERR_AD_RETURN_TIMEOUT,	//AD回应消息超时
	ERR_REQ_SUBSVR,
	ERR_SUBSVR_RETURN_TIMEOUT,	//子域服务器回应消息超时
	ERR_JOIN_MULTICAST_FAILED,	//0x501A	加入组播组失败
	ERR_QUIT_MULTICAST_FAILED,
	ERR_MC_INTER_ERROR,
	ERR_DEV_NOT_ALIVE,			/*0x501D*/

	//对讲广播相关
	ERR_DEV_ISUSING_BY_HIGHER_USER,	//设备正被更高优先级用户占用
	ERR_NO_VESTED_BROARDCAST_DEV,		//没有划归给该用户的广播设备
	ERR_NO_ALIVE_VESTED_BROARDCAST_DEV,	//没有在线的划归给该用户的广播设备

	ERR_MALLOC				 ,
	ERR_MC_NEW_SOCKET		 , 
	ERR_MC_SET_OPT			 ,
	ERR_MC_BIND				,

	//新增
	ERR_EXCEED_TCP_THREAD_NUM,		//超过服务器支持的最大TCP连接数

	ERR_REQ_FAIL=VS_ERR_AD_BASE,
	ERR_REQ_OK,   
	ERR_ACT_FAIL, 
	ERR_ACT_OK,   

	ERR_NO_FILE=VS_ERR_CTM_BASE,
	ERR_FILE_NOT_EXISIT,   
	ERR_FILE_PROTECTED,   

	ERR_SERVER_INTERNAL_ERROR,   
	ERR_CLIENT_CANCEL, 
	ERR_UPLOAD_FAIL, 
	
	ERR_FILE_IN_USE,   
	ERR_CREAT_FTP_ACCOUNT_FAIL, 	
	ERR_FILE_OPERATION_FAILD,

	AUTH_MSG_HEAD_ERROR=VS_ERR_AUTH_BASE,
	AUTH_MSG_LENGTH_ERROR,
	AUTH_MSG_CHECK_FAIL,
	AUTH_MSG_CRYPTO_LEN_ERROR,
	AUTH_MSG_ENCRYPT_ERROR,
	AUTH_MSG_DECRYPT_ERROR,
	AUTH_MSG_UNKNOWN,
	AUTH_DB_STR_LEN_ERROR,
	AUTH_DB_GRAMMA_ERROR,
	AUTH_LENGTH_FLOW,
	AUTH_CONNECT_CLOSE,
	AUTH_PROF_ERROR,
	AUTH_IP_PORT_UNMATCH,
	AUTH_USR_NOT_FOUND,
	AUTH_GRP_NOT_FOUND,
	AUTH_PASSWORD_INCORRECT,
	AUTH_USR_EXIST,
	AUTH_GRP_EXIST,
	AUTH_NO_RESPONSE,
	AUTH_MEMORY_ERROR,
	AUTH_OPEN_DB_FILE_ERROR,
	AUTH_NO_PRIVILEGE,
	AUTH_ID_ERROR,
	AUTH_NAME_ERROR,
	AUTH_LOGIN_DOMAIN_ERROR,
	AUTH_ACC_DOMAIN_ERROR,
	AUTH_BLG_DOMAIN_ERROR,
	AUTH_GRP_ERROR,
	AUTH_ENABLE_ERROR,
	AUTH_PRIORITY_ERROR,
	AUTH_VERSION_ERROR,
	AUTH_REC_EXIST,
	AUTH_NO_REFERENCED_ROW,
	AUTH_DB_ERROR,
	AUTH_REC_NOT_FOUND,
	AUTH_IS_REFERENCED_ROW,
	AUTH_EXCEED_LOGON_TIME,
	AUTH_USER_DISABLED,
	AUTH_CREATE_HBTASK_ERROR,
	AUTH_START_NOT_FINISH,
	AUTH_TVWALL_DOMAIN_ERROR,
	AUTH_UNKNOWN_CLIENT_TYPE,
	AUTH_HEARTBEAT_LOST,
	AUTH_HAS_LOGIN,
	AUTH_NAME_REPEATED,//名字重复
	AUTH_MOBILEPHONE_ERROR,//手机号码错误
	AUTH_EMAILADDR_ERROR,//Email错误
	AUTH_EXCEED_MAX_USER,//超过最大登录用户数
	AUTH_SENDMSG_ERROR,//发送消息失败
	
};


#endif /* __ERR_CODE_HEADER__ */

