📄 transport.h
字号:
IN int annexMElement,
IN int msgType);
typedef
/**************************************************************************************
* cmEvTransNewAnnexLMessage (CALLBACK)
*
* Purpose: To report to the user that an Annex M message was just received.
*
* Input: hsTransSession - The stack handle of the session.
* haTransSession - The application handle of the session.
* annexLElement - The node id of the annex L element of tunneling
* msgType - The type of the message from which tunneled msgs came.
*
**************************************************************************************/
TRANSERR (*cmEvTransNewAnnexLMessageT)(IN HSTRANSSESSION hsTransSession,
IN HATRANSSESSION haTransSession,
IN int annexLElement,
IN int msgType);
typedef struct
{
cmEvTransNewSessionT cmEvTransNewSession;
cmEvTransConnectionOnSessionClosedT cmEvTransConnectionOnSessionClosed;
cmEvTransSessionNewConnectionT cmEvTransSessionNewConnection;
cmEvTransNewMessageT cmEvTransNewMessage;
cmEvTransWriteT cmEvTransWrite;
cmEvTransBadMessageT cmEvTransBadMessage;
cmEvTransGetMessageNodeT cmEvTransGetMessageNode;
cmEvTransNewH450MessageT cmEvTransNewH450Message;
cmEvTransNewAnnexMMessageT cmEvTransNewAnnexMMessage;
cmEvTransNewAnnexLMessageT cmEvTransNewAnnexLMessage;
} TRANSSESSIONEVENTS;
/**************************************************************************************/
/* Host related callbacks that are used by the transport module */
/**************************************************************************************/
typedef
/**************************************************************************************
* cmEvTransHostConnected (CALLBACK)
*
* Purpose: To report to the user that a new host connection was established., and what
* kind of connection it is.
*
* Input: hsTransHost - The stack handle of the host.
* haTransHost - The application handle of host.
* type - The type of the connection (Q.931/H.245).
* isOutgoing - RV_TRUE for outgoing (connected),RV_FALSE for incoming (accepted)
*
**************************************************************************************/
TRANSERR (*cmEvTransHostConnectedT)(IN HSTRANSHOST hsTransHost,
IN HATRANSHOST haTransHost,
IN TRANSCONNTYPE type,
IN RvBool isOutgoing);
typedef
/**************************************************************************************
* cmEvTransHostClosed (CALLBACK)
*
* Purpose: To report to the user that a host connection was closed, either normally (i.e.
* by the other end) or abnormaly due to errors.
*
* Input: hsTransHost - The stack handle of the host.
* haTransHost - The application handle of the host.
* wasConnected - RV_TRUE: The host was connected before it was closed
* RV_FALSE: The host never reached connection before it was closed.
*
**************************************************************************************/
TRANSERR (*cmEvTransHostClosedT)( IN HSTRANSHOST hsTransHost,
IN HATRANSHOST haTransHost,
IN RvBool wasConnected);
typedef
/**************************************************************************************
* cmEvTransNewRawMessage (CALLBACK)
*
* Purpose: To report to the user that an encoded message was just received on the
* host connection.
*
* Input: hsTransHost - The stack handle of the host.
* haTransHost - The application handle of the host.
* type - The type of the message (Q.931, H.245)
* pvtNode - see output params
* msg - The encoded message
* msgSize - The encoded message size
* decoded - see output params
* pvtNode - The root pvt of the message for decoding.
*
* Output: pvtNode - The pvt tree of the message after decoding.
* decoded - The number of bytes that were decoded
* hMsgContext - external context associated with the message
*
**************************************************************************************/
TRANSERR (*cmEvTransNewRawMessageT)(IN HSTRANSHOST hsTransHost,
IN HATRANSHOST haTransHost,
IN RvH323ConnectionType type,
INOUT int pvtNode,
IN RvUint8* msg,
IN int msgSize,
OUT int* decoded,
OUT void** hMsgContext);
typedef
/**************************************************************************************
* cmEvTransSendRawMessage (CALLBACK)
*
* Purpose: To report to the user that a decoded message is about to be sent on
* the host connection.
*
* Input: hsTransHost - The stack handle of the host.
* haTransHost - The application handle of the host.
* hsSession - The stack handle of the session who sent the message.
* haSession - The application handle of the above session.
* pvtNode - The pvt tree of the decoded message.
* size - The maximal size of the given message.
*
* Output: msg - The message after encoding.
* msgSize - The encoded message size.
*
*
**************************************************************************************/
TRANSERR (*cmEvTransSendRawMessageT)( IN HSTRANSHOST hsTransHost,
IN HATRANSHOST haTransHost,
IN HSTRANSSESSION hsSession,
IN HATRANSSESSION haSession,
IN int pvtNode,
IN int size,
OUT RvUint8 *msg,
OUT int *msgSize);
typedef
/**************************************************************************************
* cmEvTransHostNewMessage (CALLBACK)
*
* Purpose: To report to the user that a new message arrived for a host.
*
* Input: hsTransHost - The stack handle of the host.
* haTransHost - The application handle of the host.
* type - The type of the message (Q.931/H.245).
* pvtNode - The pvt node of the decoded message.
* hMsgContext - External context associated with the message.
*
**************************************************************************************/
TRANSERR (*cmEvTransHostNewMessageT)(IN HSTRANSHOST hsTransHost,
IN HATRANSHOST haTransHost,
IN TRANSTYPE type,
IN int pvtNode,
IN void *hMsgContext);
typedef
/**************************************************************************************
* cmEvTransHostBadMessage (CALLBACK)
*
* Purpose: To report to the user that a message from a host could not be decoded.
*
* Input: hsTransHost - The stack handle of the host.
* haTransHost - The application handle of the host.
* type - The type of the message (Q.931/H.245).
* msg - The encoded message
* msgSize - The encoded message size
* outgoing - RV_TRUE: outgoing message; RV_FALSE-incoming message
* hMsgContext - An external context associated with the message.
*
*
**************************************************************************************/
TRANSERR (*cmEvTransHostBadMessageT)(IN HSTRANSHOST hsTransHost,
IN HATRANSHOST haTransHost,
IN TRANSTYPE type,
IN RvUint8 *msg,
IN int msgSize,
RvBool outgoing,
void *hMsgContext);
typedef
/**************************************************************************************
* cmEvTransHostMultiplexChangeState (CALLBACK)
*
* Purpose: To report to the user that a message from a host could not be decoded.
*
* Input: hsTransHost - The stack handle of the host.
* haTransHost - The application handle of the host.
* type - The type of the message (Q.931/H.245).
* msg - The encoded message
* msgSize - The encoded message size
* outgoing - RV_TRUE: outgoing message; RV_FALSE-incoming message
* hMsgContext - An external context associated with the message.
*
*
**************************************************************************************/
TRANSERR (*cmEvTransHostMultiplexChangeStateT)(IN HSTRANSHOST hsTransHost,
IN HATRANSHOST haTransHost,
IN RvBool multiplexOn);
typedef
/**************************************************************************************
* cmEvTransHostListen (CALLBACK)
*
* Purpose: To report to the user that we are about to listen to TCP connections
*
*
* Input: hsTransHost - The stack handle of the host.
* haTransHost - The application handle of the host.
* type - The type of the connection (Q.931/H.245).
* address - Address to listen on
*
* returned value
* cmTransOK - proceed with listen
* cmTransIgnoreMessage - do not listen
**************************************************************************************/
TRANSERR (*cmEvTransHostListenT)(
IN HSTRANSHOST hsTransHost,
IN HATRANSHOST haTransHost,
IN TRANSCONNTYPE type,
IN cmTransportAddress *address);
typedef
/**************************************************************************************
* cmEvTransHostListening (CALLBACK)
*
* Purpose: To report to the user that we are listening on a TCP connections
*
*
* Input: hsTransHost - The stack handle of the host.
* haTransHost - The application handle of the host.
* type - The type of the connection (Q.931/H.245).
* address - Address of listening socket
* error - RV_TRUE if listen has failed
*
**************************************************************************************/
TRANSERR (*cmEvTransHostListeningT)(
IN HSTRANSHOST hsTransHost,
IN HATRANSHOST haTransHost,
IN TRANSCONNTYPE type,
IN cmTransportAddress *address,
IN RvBool error);
typedef
/**************************************************************************************
* cmEvTransHostConnecting (CALLBACK)
*
* Purpose: To report to the user that we are about to connect to a TCP address
*
*
* Input: hsTransHost - The stack handle of the host.
* haTransHost - The application handle of the host.
* type - The type of the connection (Q.931/H.245).
* address - Address to connct to
*
* returned value
* cmTransOK - proceed with connect
* cmTransIgnoreMessage - do not connect
**************************************************************************************/
TRANSERR (*cmEvTransHostConnectingT)(
IN HSTRANSHOST hsTransHost,
IN HATRANSHOST haTransHost,
IN TRANSCONNTYPE type,
IN cmTransportAddress *address);
typedef struct
{
cmEvTransHostConnectedT cmEvTransHostConnected;
cmEvTransHostClosedT cmEvTransHostClosed;
cmEvTransNewRawMessageT cmEvTransNewRawMessage;
cmEvTransSendRawMessageT cmEvTransSendRawMessage;
cmEvTransHostNewMessageT cmEvTransHostNewMessage;
cmEvTransHostBadMessageT cmEvTransHostBadMessage;
cmEvTransHostMultiplexChangeStateT cmEvTransHostMultiplexChangeState;
cmEvTransHostListenT cmEvTransHostListen;
cmEvTransHostListeningT cmEvTransHostListening;
cmEvTransHostConnectingT cmEvTransHostConnecting;
} TRANSHOSTEVENTS;
/**************************************************************************************
* A P I
**************************************************************************************/
/**************************************************************************************
* cmTransInit
*
* Purpose: To initialize the entire transport module
*
* Input: hAppATrans - The application handle to the entire transport module
* hPvt - The handle to the stack's PVT.
* selEngine - select engine to use
* numOfSessions - The maximal amount of session elemnts to allocate.
* numOfHostConnections - The maximal amount of host elemnts to allocate.
* poolSizeInKB - maximum amount of storage for messages before send
* maxMessageSize - Maximal size of encoded message.
* annexESupported - Do we support annex E.
* portRange - Port range to use
*
* Output: None.
*
* Returned value: A handle to the entire transport module
*
**************************************************************************************/
HAPPTRANS cmTransInit(IN HAPPATRANS hAppATrans,
IN HPVT hPvt,
IN RvSelectEngine* selEngine,
IN int numOfSessions,
IN int numOfHostConnections,
IN int poolSizeInKB,
IN int maxMessageSize,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -