⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 transnet.h

📁 基于h323协议的软phone
💻 H
📖 第 1 页 / 共 2 页
字号:
/***********************************************************************
        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 _TRANSNET_H
#define _TRANSNET_H


#ifdef __cplusplus
extern "C" {
#endif

/**************************************************************************************
 * createHostByType
 *
 * Purpose: To allocate a new host element and fill it with data according to its
 *          type, i.e. Q.931-TPKT, Q.931-Annex E, H.245
 *
 * Input:  transGlobals     - The global variables of the module
 *         hsTranSession    - The session for which the host is created (may be NULL)
 *         type             - The type of the connection (TPKT, H.245, Annex E)
 *         hTpkt            - The connection handle in TPKT for a new incoming connection
 *         annexEUsageMode  - is this an annex E host or other, i.e. TPKT for Q.931 or H.245
 *
 * Output: hsTransHost -  A handle for the newly created host element.
 *
 **************************************************************************************/
 TRANSERR createHostByType( cmTransGlobals      *transGlobals,
                            HSTRANSSESSION      hsTransSession,
                            HSTRANSHOST         *hsTransHost,
                            TRANSCONNTYPE       type,
                            HTPKT               hTpkt,
                            cmAnnexEUsageMode   annexEUsageMode);

/**************************************************************************************
 * determineWinningHost
 *
 * Purpose: check if there was a competition between TPKT and annex E, and if so
 *          close the Annex E.
 *
 * Input:   transGlobals  - The global variables of the module
 *          session       - The session for which the conection was made
 *          annexEWon     - which of the two hosts won..
 *
 * Return Value: RV_TRUE - The decision was not overturned, RV_FALSE - Otherwise.
 **************************************************************************************/
RvBool determineWinningHost(cmTransGlobals *transGlobals, cmTransSession *session, RvBool annexEWon);

/**************************************************************************************
 * transReportConnect
 *
 * Purpose: To invoke the callbacks for the connected host and all its associated sessions
 *
 * Input: host         - The host which got connected.
 *        session      - The session on which to report the host connection (NULL for all).
 *        isConnected  - RV_TRUE: A connect happened, RV_FALSE: an accept happened.
 *
 **************************************************************************************/
void transReportConnect(cmTransHost *host, cmTransSession *session, RvBool isConnected);

/**************************************************************************************
 * solveH245Conflict
 *
 * Purpose: To decide which one of two coliding H.245 connections will survive.
 *
 * Input: host         - The h.245 host which has a listen and connecting processes.
 *
 **************************************************************************************/
void solveH245Conflict(cmTransHost *host);

 /**************************************************************************************
 * transQ931AcceptHandler
 *
 * Purpose: The callback routine for the socket that listens for incoming Q.931 requests
 *
 * Input: standard input of TPKT callback
 *
 **************************************************************************************/
 void transQ931AcceptHandler(HTPKT tpkt,RvSelectEvents event,int length,int error,void*context);

 /**************************************************************************************
 * transH245Handler
 *
 * Purpose: The callback routine for a H245 connection
 *
 * Input: standard input of TPKT callback
 *
 **************************************************************************************/
 void transH245Handler(HTPKT tpkt,RvSelectEvents event,int length,int error,void*context);

 /**************************************************************************************
 * transH245AcceptHandler
 *
 * Purpose: The callback routine for the socket that listens for incoming H.245 request
 *
 * Input: standard input of TPKT callback
 *
 **************************************************************************************/
 void transH245AcceptHandler(HTPKT tpkt,RvSelectEvents event,int length,int error,void*context);

 /**************************************************************************************
 * transQ931Handler
 *
 * Purpose: The callback routine for a Q.931 connection
 *
 * Input: standard input of TPKT callback
 *
 *
 **************************************************************************************/
 void transQ931Handler(HTPKT tpkt,RvSelectEvents event,int length,int error,void*context);

/**************************************************************************************
 * transHostConnect
 *
 * Purpose: Starts the process of connecting on the given host connection.
 *
 * Input:   hsTransSession  - the handle to the session.
 *          type            - The type of the connection (annex E or TPKT)
 *
 * Output:  None.
 *
 * Returned Value:  cmTransWouldBlock - In case that a connect procedure was instigated but
 *                                      not yet completed.
 *                  cmTransOK         - In case that the connection is already opened.
 *                  cmTransErr        - couldn't create the hosts
 **************************************************************************************/
TRANSERR transHostConnect(IN HSTRANSSESSION hsTransSession,
                          IN TRANSINTCONNTYPE  type);

/**************************************************************************************
 * sendMessageOnHost
 *
 * Purpose: send a message on the given host according to its communication protocol.
 *          this will also send any messages that are linked after this one.
 *
 * Input:   transGlobal - The global variables of the module.
 *          host        - The host on which to send the messages that await to be sent.
 *          rpoolMessage- RPOOL message to send on the host
 *
 * Output:  None.
 *
 * Returned Value:  cmTransOK             - All is ok.
 *                  cmTransConnectionBusy - The connection is still sending previous messages.
 **************************************************************************************/
TRANSERR sendMessageOnHost(
    IN cmTransGlobals*  transGlobals,
    IN cmTransHost*     host);

/**************************************************************************************
 * decodeIncomingMessage
 *
 * Purpose: tries to receive and decode an incoming message
 *
 * Input:   tpkt    - a handle to the TPKT connection
 *          length  - the length of the received message (0 if no buffers for reading the message)
 *          offset  - Where to start the decoding process in the encoded buffer
 *          context - The context associated with the connection , i.e. the host element
 *          node    - The pvt node into which to decode the message
 *          type    - The type of the message.
 *
 *
 * Output:  hMsgContext - An external context associated with the message.
 *
 * Returned Value:  number of bytes decoded, or <=0 in case of trouble.
 **************************************************************************************/
int  decodeIncomingMessage( HTPKT       tpkt,
                            int         *length,
                            int         *offset,
                            void        *context,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -