/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\

File: OCTVC1_NET_EVT.h
$Octasic_Copyright: $

Description: Contains the event definition of the NET API.

$Octasic_Confidentiality: $

$Octasic_Release: $

$Octasic_Revision: $

\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

#ifndef __OCTVC1_NET_EVT_H__
#define __OCTVC1_NET_EVT_H__


/*****************************  INCLUDE FILES  *******************************/

#include "octvc1_net_api.h"

/************************  COMMON DEFINITIONS  *******************************/

/*-------------------------------------------------------------------------------------
 	NET API event max.
-------------------------------------------------------------------------------------*/

#define cOCTVC1_NET_EVT_ICMP_ALARM_PKT_HEADER_MAX_SIZE		68		
#define cOCTVC1_NET_EVT_MAX_CNAME_BUFFER_SIZE				256		
#define cOCTVC1_NET_EVT_MAX_RTCP_PKT_BUFFER_SIZE			512		

/*-------------------------------------------------------------------------------------
	tOCTVC1_NET_REMOTE_ADDRESS_ENUM :
-------------------------------------------------------------------------------------*/
#define tOCTVC1_NET_REMOTE_ADDRESS_ENUM						tOCT_UINT32

#define cOCTVC1_NET_REMOTE_ADDRESS_ENUM_RTP					1		
#define cOCTVC1_NET_REMOTE_ADDRESS_ENUM_RTCP				2		
#define cOCTVC1_NET_REMOTE_ADDRESS_ENUM_T38_UDPTL			3		

/*****************************  NOTIFICATIONS  **********************************/
/*-------------------------------------------------------------------------------------
	tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_RTCP_PKT_EVT

 Members:
	Header
 		OCTVC1 Event Header
	hRtpSession
	ulMemberId
	ulPktType
	ulPktByteLength
	abyRtcpPkt
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER			Header;
	tOCTVC1_HANDLE					hRtpSession;
	tOCT_UINT32						ulMemberId;
	tOCTVC1_NET_RTCP_PKT_TYPE_ENUM	ulPktType;
	tOCT_UINT32						ulPktByteLength;
	tOCT_UINT8						abyRtcpPkt[cOCTVC1_NET_EVT_MAX_RTCP_PKT_BUFFER_SIZE];

} tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_RTCP_PKT_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_RTCP_REMOTE_DETECTED_EVT

 Members:
	Header
 		OCTVC1 Event Header
	hRtpSession
	ulMemberId
	ulCnameLength
	achCname
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER	Header;
	tOCTVC1_HANDLE			hRtpSession;
	tOCT_UINT32				ulMemberId;
	tOCT_UINT32				ulCnameLength;
	tOCT_UINT8				achCname[cOCTVC1_NET_EVT_MAX_CNAME_BUFFER_SIZE];

} tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_RTCP_REMOTE_DETECTED_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_RTCP_SSRC_CHANGE_EVT

 Members:
	Header
 		OCTVC1 Event Header
	hRtpSession
	ulMemberId
	ulLocalFlag
	ulPreviousSsrc
	ulNewSsrc
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER	Header;
	tOCTVC1_HANDLE			hRtpSession;
	tOCT_UINT32				ulMemberId;
	tOCT_BOOL32				ulLocalFlag;
	tOCT_UINT32				ulPreviousSsrc;
	tOCT_UINT32				ulNewSsrc;

} tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_RTCP_SSRC_CHANGE_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_RTCP_RECEIVER_ALARM_EVT

 Members:
	Header
 		OCTVC1 Event Header
	hRtpSession
	ulMemberId
	ulLocalFlag
	ulRoundTripTime
	ulMaxRoundTripTime
	ulAverageRoundTripTime
	StatsReceiver
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER			Header;
	tOCTVC1_HANDLE					hRtpSession;
	tOCT_UINT32						ulMemberId;
	tOCT_BOOL32						ulLocalFlag;
	tOCT_UINT32						ulRoundTripTime;
	tOCT_UINT32						ulMaxRoundTripTime;
	tOCT_UINT32						ulAverageRoundTripTime;
	tOCTVC1_NET_RTCP_RECEIVER_STATS	StatsReceiver;

} tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_RTCP_RECEIVER_ALARM_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_RTCP_SENDER_STATE_CHANGE_EVT

 Members:
	Header
 		OCTVC1 Event Header
	hRtpSession
	ulMemberId
	ulLocalFlag
	ulPreviousSenderState
	ulNewSenderState
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER				Header;
	tOCTVC1_HANDLE						hRtpSession;
	tOCT_UINT32							ulMemberId;
	tOCT_BOOL32							ulLocalFlag;
	tOCTVC1_NET_RTP_SENDER_STATE_ENUM	ulPreviousSenderState;
	tOCTVC1_NET_RTP_SENDER_STATE_ENUM	ulNewSenderState;

} tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_RTCP_SENDER_STATE_CHANGE_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_REMOTE_AUTO_DETECT_EVT

 Members:
	Header
 		OCTVC1 Event Header
	hRtpSession
	ulMemberId
	ulRemoteAddress
	RemoteUdpAddress
 		UDP address that has been auto-detected.
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER			Header;
	tOCTVC1_HANDLE					hRtpSession;
	tOCT_UINT32						ulMemberId;
	tOCTVC1_NET_REMOTE_ADDRESS_ENUM	ulRemoteAddress;
	tOCTVC1_UDP_ADDRESS				RemoteUdpAddress;

} tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_REMOTE_AUTO_DETECT_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_SRTP_MASTER_RE_KEY_THRESHOLD_REACHED_EVT

 Members:
	Header
 		OCTVC1 Event Header
	hRtpSession
	ulMemberId
	ulSrtpStreamType
	ActiveSrtpKey
	aulSrtpPacketCnt
	ulSrtcpPacketCnt
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER				Header;
	tOCTVC1_HANDLE						hRtpSession;
	tOCT_UINT32							ulMemberId;
	tOCTVC1_NET_SRTP_STREAM_TYPE_ENUM	ulSrtpStreamType;
	tOCTVC1_NET_SRTP_KEY_ENTRY			ActiveSrtpKey;
	tOCT_UINT32							aulSrtpPacketCnt[2];
	tOCT_UINT32							ulSrtcpPacketCnt;

} tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_SRTP_MASTER_RE_KEY_THRESHOLD_REACHED_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_SRTP_MASTER_KEY_EXPIRED_EVT

 Members:
	Header
 		OCTVC1 Event Header
	hRtpSession
	ulMemberId
	ulSrtpStreamType
	ActiveSrtpKey
	aulSrtpPacketCnt
	ulSrtcpPacketCnt
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER				Header;
	tOCTVC1_HANDLE						hRtpSession;
	tOCT_UINT32							ulMemberId;
	tOCTVC1_NET_SRTP_STREAM_TYPE_ENUM	ulSrtpStreamType;
	tOCTVC1_NET_SRTP_KEY_ENTRY			ActiveSrtpKey;
	tOCT_UINT32							aulSrtpPacketCnt[2];
	tOCT_UINT32							ulSrtcpPacketCnt;

} tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_SRTP_MASTER_KEY_EXPIRED_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_SRTP_MASTER_KEY_CHANGE_DETECTED_EVT

 Members:
	Header
 		OCTVC1 Event Header
	hRtpSession
	ulMemberId
	ulSrtpStreamType
	ulKeyChangeReason
	ActiveSrtpKey
	PreviousSrtpKey
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER							Header;
	tOCTVC1_HANDLE									hRtpSession;
	tOCT_UINT32										ulMemberId;
	tOCTVC1_NET_SRTP_STREAM_TYPE_ENUM				ulSrtpStreamType;
	tOCTVC1_NET_SRTP_STREAM_KEY_CHANGE_REASON_ENUM	ulKeyChangeReason;
	tOCTVC1_NET_SRTP_KEY_ENTRY						ActiveSrtpKey;
	tOCTVC1_NET_SRTP_KEY_ENTRY						PreviousSrtpKey;

} tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_SRTP_MASTER_KEY_CHANGE_DETECTED_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_SRTP_REPLAY_ATTACK_DETECTED_EVT

 Members:
	Header
 		OCTVC1 Event Header
	hRtpSession
	ulMemberId
	ulSrtpStreamType
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER				Header;
	tOCTVC1_HANDLE						hRtpSession;
	tOCT_UINT32							ulMemberId;
	tOCTVC1_NET_SRTP_STREAM_TYPE_ENUM	ulSrtpStreamType;

} tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_SRTP_REPLAY_ATTACK_DETECTED_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_SRTP_UNAUTH_PKT_DETECTED_EVT

 Members:
	Header
 		OCTVC1 Event Header
	hRtpSession
	ulMemberId
	ulSrtpStreamType
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER				Header;
	tOCTVC1_HANDLE						hRtpSession;
	tOCT_UINT32							ulMemberId;
	tOCTVC1_NET_SRTP_STREAM_TYPE_ENUM	ulSrtpStreamType;

} tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_SRTP_UNAUTH_PKT_DETECTED_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_SRTP_UNKNOWN_MKI_RECEIVED_EVT

 Members:
	Header
 		OCTVC1 Event Header
	hRtpSession
	ulMemberId
	ulSrtpStreamType
	ulUnknownMkiByteSize
	abyUnknownMkiValue
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER				Header;
	tOCTVC1_HANDLE						hRtpSession;
	tOCT_UINT32							ulMemberId;
	tOCTVC1_NET_SRTP_STREAM_TYPE_ENUM	ulSrtpStreamType;
	tOCT_UINT32							ulUnknownMkiByteSize;
	tOCT_UINT8							abyUnknownMkiValue[cOCTVC1_NET_MAX_SRTP_MKI_VALUE_BYTE_SIZE];

} tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_SRTP_UNKNOWN_MKI_RECEIVED_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_SRTP_SSRC_VIOLATION_DETECTED_EVT

 Members:
	Header
 		OCTVC1 Event Header
	hRtpSession
	ulMemberId
	ulSrtpStreamType
	ulSsrc
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER				Header;
	tOCTVC1_HANDLE						hRtpSession;
	tOCT_UINT32							ulMemberId;
	tOCTVC1_NET_SRTP_STREAM_TYPE_ENUM	ulSrtpStreamType;
	tOCT_UINT32							ulSsrc;

} tOCTVC1_NET_MSG_RTP_SESSION_MEMBER_SRTP_SSRC_VIOLATION_DETECTED_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_NET_MSG_LOCAL_HOST_ICMP_ALARM_EVT

 Members:
	Header
 		OCTVC1 Event Header
	hLocalHost
	RemoteIpAddr
	ulAlarmType
	ulAlarmCode
	ulPktHeaderByteLength
	abyPktHeader
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER	Header;
	tOCTVC1_HANDLE			hLocalHost;
	tOCTVC1_IP_ADDRESS		RemoteIpAddr;
	tOCT_UINT32				ulAlarmType;
	tOCT_UINT32				ulAlarmCode;
	tOCT_UINT32				ulPktHeaderByteLength;
	tOCT_UINT8				abyPktHeader[cOCTVC1_NET_EVT_ICMP_ALARM_PKT_HEADER_MAX_SIZE];

} tOCTVC1_NET_MSG_LOCAL_HOST_ICMP_ALARM_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_NET_MSG_LOCAL_HOST_ICMP_REDIRECT_EVT

 Members:
	Header
 		OCTVC1 Event Header
	hLocalHost
	ulRedirectCode
	NewGatewayIpAddress
	PrevGatewayIpAddress
	DestinationIpAddress
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER	Header;
	tOCTVC1_HANDLE			hLocalHost;
	tOCT_UINT32				ulRedirectCode;
	tOCTVC1_IP_ADDRESS		NewGatewayIpAddress;
	tOCTVC1_IP_ADDRESS		PrevGatewayIpAddress;
	tOCTVC1_IP_ADDRESS		DestinationIpAddress;

} tOCTVC1_NET_MSG_LOCAL_HOST_ICMP_REDIRECT_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_NET_MSG_LOCAL_HOST_ADDR_STATUS_CHANGE_EVT

 Members:
	Header
 		OCTVC1 Event Header
	hLink
	hLocalHost
	IpAddress
	ulAddrAutoConfigFlag
	ulPreviousAddrStatus
	ulNewAddrStatus
	ulStatusChangeCause
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER									Header;
	tOCTVC1_HANDLE											hLink;
	tOCTVC1_HANDLE											hLocalHost;
	tOCTVC1_IP_ADDRESS										IpAddress;
	tOCT_BOOL32												ulAddrAutoConfigFlag;
	tOCTVC1_NET_LOCAL_HOST_ADDR_STATUS_ENUM					ulPreviousAddrStatus;
	tOCTVC1_NET_LOCAL_HOST_ADDR_STATUS_ENUM					ulNewAddrStatus;
	tOCTVC1_NET_LOCAL_HOST_ADDR_STATUS_CHANGE_CAUSE_ENUM	ulStatusChangeCause;

} tOCTVC1_NET_MSG_LOCAL_HOST_ADDR_STATUS_CHANGE_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_NET_MSG_LOCAL_HOST_ADDR_DUPLICATE_FOUND_EVT

 Members:
	Header
 		OCTVC1 Event Header
	hLocalHost
 		Local Host which has a duplicate IP address.
	IpAddress
 		IP Address which is in conflict.
	ulDuplicateSource
 		What triggered the event to be sent.
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER								Header;
	tOCTVC1_HANDLE										hLocalHost;
	tOCTVC1_IP_ADDRESS									IpAddress;
	tOCTVC1_NET_LOCAL_HOST_ADDR_DUPLICATE_SOURCE_ENUM	ulDuplicateSource;

} tOCTVC1_NET_MSG_LOCAL_HOST_ADDR_DUPLICATE_FOUND_EVT;

/*-------------------------------------------------------------------------------------
	tOCTVC1_NET_MSG_LINK_GATEWAY_STATUS_CHANGE_EVT

 Members:
	Header
 		OCTVC1 Event Header
	hEthLink
	IpAddress
	ulPreviousStatus
	ulNewStatus
-------------------------------------------------------------------------------------*/
typedef struct
{
	tOCTVC1_EVENT_HEADER					Header;
	tOCTVC1_HANDLE							hEthLink;
	tOCTVC1_IP_ADDRESS						IpAddress;
	tOCTVC1_NET_LINK_GATEWAY_STATUS_ENUM	ulPreviousStatus;
	tOCTVC1_NET_LINK_GATEWAY_STATUS_ENUM	ulNewStatus;

} tOCTVC1_NET_MSG_LINK_GATEWAY_STATUS_CHANGE_EVT;


#endif /* __OCTVC1_NET_EVT_H__ */

