📄 cmhook.h
字号:
/***********************************************************************
Copyright (c) 2002 RADVISION Ltd.
************************************************************************
NOTICE:
This document contains information that is confidential and proprietary
to RADVISION Ltd.. No part of this document may be reproduced in any
form whatsoever without written prior approval by RADVISION Ltd..
RADVISION Ltd. reserve the right to revise this publication and make
changes without obligation to notify any person of such revisions or
changes.
***********************************************************************/
#ifndef _RV_CMHOOK_H
#define _RV_CMHOOK_H
#ifdef __cplusplus
extern "C" {
#endif
typedef RvBool
(RVCALLCONV *cmHookListenT)(/*Before listen*/
IN HPROTCONN hConn,
IN int addr
);
typedef int
(RVCALLCONV *cmHookListeningT)(/*After listen*/
IN HPROTCONN hConn,
IN int addr,
IN RvBool error
);
typedef int
(RVCALLCONV*cmHookConnectingT)(/*Before connect*/
IN HPROTCONN hConn,
IN int addr
);
typedef int
(RVCALLCONV*cmHookInConnT)(/*Incomming connect*/
IN HPROTCONN hConn,
IN int addrFrom,
IN int addrTo
);
typedef int
(RVCALLCONV*cmHookOutConnT)(/*Outgoing connect*/
IN HPROTCONN hConn,
IN int addrFrom,
IN int addrTo,
IN RvBool error
);
typedef RvBool
(RVCALLCONV*cmHookSendT)(
IN HPROTCONN hConn,
IN int nodeId,
IN RvBool error
);
typedef RvBool
(RVCALLCONV*cmHookRecvT)(
IN HPROTCONN hConn,
IN int nodeId,
IN RvBool error
);
typedef RvBool
(RVCALLCONV*cmHookSendToT)(
IN HPROTCONN hConn,
IN int nodeId,
IN int addrTo,
IN RvBool error
);
typedef RvBool
(RVCALLCONV*cmHookRecvFromT)(
IN HPROTCONN hConn,
IN int nodeId,
IN int addrFrom,
IN RvBool multicast,
IN RvBool error
);
typedef void
(RVCALLCONV*cmHookCloseT)(
IN HPROTCONN hConn
);
typedef struct
{
cmHookListenT hookListen;
cmHookListeningT hookListening;
cmHookConnectingT hookConnecting;
cmHookInConnT hookInConn;
cmHookOutConnT hookOutConn;
cmHookSendT hookSend;
cmHookRecvT hookRecv;
cmHookSendToT hookSendTo;
cmHookRecvFromT hookRecvFrom;
cmHookCloseT hookClose;
} SCMPROTOCOLEVENT,*CMPROTOCOLEVENT;
/************************************************************************
* cmSetProtocolEventHandler
* purpose: Installs the protocol event handler.
* input : hApp - Stack handle for the application
* cmProtocolEvent - Pointer to array of pointers to general event callback functions
* size - Size of *cmProtocolEvent in bytes
* output : none
* return : Non-negative value on success
* Negative value on failure
************************************************************************/
RVAPI
int RVCALLCONV cmSetProtocolEventHandler(
IN HAPP hApp,
IN CMPROTOCOLEVENT cmProtocolEvent,
IN int size);
RVAPI
int RVCALLCONV cmSetProtocolEventHandlerReplacement(
IN HAPP hApp,
IN CMPROTOCOLEVENT cmProtocolEventReplacement,
IN int size);
/************************************************************************
* cmProtocolSendMessage
* purpose: Send a message through a given connection
* This function should be used for Q931 and H.245 messages
* input : hApp - Stack handle for the application
* hConn - Connection to use
* msg - Node id of the message to send
* The message is not deleted by the call to this function
* output : none
* return : Non-negative value on success
* Negative value on failure
************************************************************************/
RVAPI
int RVCALLCONV cmProtocolSendMessage(
IN HAPP hApp,
IN HPROTCONN hConn,
IN int msg);
RVAPI
int RVCALLCONV cmProtocolSendMessageTo(
IN HAPP hApp,
IN HPROTCONN hConn,
IN int msg,
IN int addr);
typedef enum
{
cmProtocolUnknown,
cmProtocolRAS,
cmProtocolQ931,
cmProtocolH245
} cmProtocol;
/* Creates new message value tree*/
RVAPI int /* New message nodeId*/
RVCALLCONV cmProtocolCreateMessage(
IN HAPP hApp,
IN cmProtocol protocol);
RVAPI/* returns protocol of the message tree*/
cmProtocol RVCALLCONV cmProtocolGetProtocol(
IN HAPP hApp,
IN int msg);/* message nodeId*/
RVAPI
char* RVCALLCONV cmProtocolGetProtocolName(
IN cmProtocol protocol);
/************************************************************************
* cmProtocolGetLocalAddress
* purpose: Get the local address of a given connection of the stack.
* This function can be used on Q.931 or H.245 connections.
* input : hApp - Stack handle for the application
* hConn - Connection to use
* output : address - The local address of this connection
* return : Non-negative value on success
* Negative value on failure
************************************************************************/
RVAPI
int RVCALLCONV cmProtocolGetLocalAddress(
IN HAPP hApp,
IN HPROTCONN hConn,
OUT cmTransportAddress* address);
/************************************************************************
* cmProtocolGetRemoteAddress
* purpose: Get the remote address of a given connection of the stack.
* This function can be used on Q.931 or H.245 connections.
* input : hApp - Stack handle for the application
* hConn - Connection to use
* output : address - The remote address of this connection
* return : Non-negative value on success
* Negative value on failure
************************************************************************/
RVAPI
int RVCALLCONV cmProtocolGetRemoteAddress(
IN HAPP hApp,
IN HPROTCONN hConn,
OUT cmTransportAddress* address);
/************************************************************************
* cmProtocolSetTypeOfService
* purpose: Set the connection's DiffServ Code Point value. This is used
* for QoS.
* This function can be used on RAS, Q.931 or H.245 connections.
* input : hApp - Stack handle for the application
* hConn - Connection to use
* typeOfService - Type of service value
* output : none
* return : Non-negative value on success
* Negative value on failure
************************************************************************/
RVAPI
int RVCALLCONV cmProtocolSetTypeOfService(
IN HAPP hApp,
IN HPROTCONN hConn,
IN RvInt typeOfService);
#ifdef __cplusplus
}
#endif
#endif /* _RV_CMHOOK_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -