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

📄 transacmng.h

📁 mgcp协议源代码和测试程序,还有一个编译器
💻 H
字号:
/******************************************************************************
  Copyright(C) 2005,2006 Frank ZHANG

  All Rights Reserved.
    
  This program is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published by the Free
  Software Foundation; either version 2 of the License, or (at your option)
  any later version.

  This program is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 
  more details.
    
  You should have received a copy of the GNU General Public License along with
  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  Place, Suite 330, Boston, MA 02111-1307 USA.
 
******************************************************************************
*      Authors                   :  Frank ZHANG (openmgcp@gmail.com)
*      Description               :  Transaction Manger module
*
*
*      Date of creation          :  08/20/2005
*
*
*      History                   :
*      2005/08/20 Frank ZHANG    : - Creation
******************************************************************************/
#ifndef __TRANSACMNG_H__
#define __TRANSACMNG_H__

#include "abnf.h"

#ifdef __cplusplus
extern "C" {#endif
#define TICK_TIMER_VALUE 100  /* 100 ms */

/* Timer and counter default value for retransmission */
#define DEF_COUNTERMAX1   5      /* Threshold of current address is unreachable */
#define DEF_COUNTERMAX2   7      /* Threshold of all CA are unavailable */
#define DEF_TIMERMAXRTO   4000   /* Max value of RTO */
#define DEF_TIMERINITRTO  200    /* Initial value of RTO */
#define DEF_TIMERMAX      20000  /* Retransmission cease threshold */
#define DEF_TIMERHIST     30000  /* The duration response retained after send, and
                                    also used to determine disconnected threshold */
#define DEF_TIMERLONGTR   5000   /* RTO value if provision response received */

#define DEF_LOW_WATERMARK 50     /* Low mark bellow which send 100 response */      
#define DEF_HIG_WATERMARK 60     /* Low mark bellow which send 101 response */


/* RTO info */
#define RTO_MAX            4000       /* Max RTO value, 4s */
#define RTO_DEFAULT        200        /* Default RTO value, 200ms */

/* Abnf encode buffer size, that is to say the max MGCP datagram size, according
 * to RFC3435, at least 4000 bytes is mandatory to be supported*/
#define ABNF_ENCODE_BUF_LEN 5000

int FindMgcpCmdOutByTranID(void *pTranCmdOut, void *pTransacID);
int FindMgcpRspAckOutByTranID(void *pRspAckOut, void *pTransacID);
int FindMgcpCmdInByTranID(void *pCmdIn, void *pTransacID);
int FindMgcpRspOutByTranID(void *pRspOut, void *pTransacID);
int FindMgcpRspOutWaitAckByTranID(void *pRspOut, void *pTransacID);
int FindMgcpRspACKByTranID(void *pRspAck, void *pTransacID);
int FindMgcpCmdOutByCmdID(void *pCmdOut, void *pCommandID);
void BuildPiggybackedCommands(H_MGCP_TRANSAC_MANAGER pTransacMng, TMGCPMsgList *pAbnfMsgList,
                              MGCP_MSG_LIST *pMsgList, WORD wNum, DWORD *pCmdID);
void FillAbnfMgcpCmdOut(H_MGCP_TRANSAC_MANAGER pTransacMng, TMGCPMsgList *pAbnfMsgList,
                        TRANSAC_CMD_OUT *pTranMgcpCmdOut);
void FillAbnfMgcpRspOut(H_MGCP_TRANSAC_MANAGER pTransacMng, TMGCPMsgList *pAbnfMsgList,
                        MGCP_RSP_OUT *pMgcpRspOut, BOOL bNeedAck);
void SendMgcpCmdOut(H_MGCP_TRANSAC_MANAGER pTransacMng, TRANSAC_CMD_OUT *pTranMgcpCmdOut);
void SendMgcpRspAckOut(H_MGCP_TRANSAC_MANAGER pTransacMng, DWORD dwTranID);
void SendMgcpRspOut(H_MGCP_TRANSAC_MANAGER pTransacMng, MGCP_RSP_OUT *pMgcpRspOut , BOOL bNeedAck);
void RemovePiggyBackingCmdID(DWORD dwCommandID, MGCP_MSG_LIST *pMsgList);
void SendProvisonalResponse(DWORD dwTransactionId, DWORD dwRspCode, int iSocket_fd,
                            DWORD dwDesAddress, WORD wDesPort);
void ProcessTransacIncomingMgcpCmd(H_MGCP_TRANSAC_MANAGER pTransacMng, MGCP_INCOMING_COMMAND *pMgcpCmd);
void ProcessTransacIncomingMgcpRsp(H_MGCP_TRANSAC_MANAGER pTransacMng, MGCP_INCOMING_RESPONSE *pMgcpRsp);
void ProcessOutGoingMgcpCmd(H_MGCP_TRANSAC_MANAGER pTransacMng, MGCP_CMD_OUT *pCmdOut);
void ProcessOutGoingMgcpRsp(H_MGCP_TRANSAC_MANAGER pTransacMng, MGCP_RSP_OUT *pRspOut);
void ProcessUpdataNotifiedEntityMsg(H_MGCP_TRANSAC_MANAGER pTransacMng, MSG_DATA_UPDATE_NE *pMsgData);
void ProcessResponseOutTimeOut(H_MGCP_TRANSAC_MANAGER pTransacMng, SLIST *pRspOutList);
void ProcessResponseWaitAckTimeOut(H_MGCP_TRANSAC_MANAGER pTransacMng, SLIST *pRspWaitingAckList);
void ProcessAckedResponseTimeOut(H_MGCP_TRANSAC_MANAGER pTransacMng);
void ProcessResponsetAckTimeOut(H_MGCP_TRANSAC_MANAGER pTransacMng);
BOOL CheckDNSToGetMoreCA(NOTIFIED_ENTITY *pNotifiedEntity);
void ProcessCommandOutTimeOut(H_MGCP_TRANSAC_MANAGER pTransacMng);
void ProcessPiggyBackCommandOutTimeOut(H_MGCP_TRANSAC_MANAGER pTransacMng);
void ProcessTimeOutMsg(H_MGCP_TRANSAC_MANAGER pTransacMng);
void* RxTask(void *pTransacMng);
void* TxTask(void *pTransacMng);
LONG TransationManagerCreate(H_MGCP_TRANSAC_MANAGER *ppTranMng, H_MGCP_STACK pStack);
void TransacMngTimeOutCbk(void *pArg);
LONG TransationManagerStart(H_MGCP_TRANSAC_MANAGER pTranMng);
void TransationManagerDestroy(H_MGCP_TRANSAC_MANAGER pTranMng);
LONG SendMsgToTransationManager(H_MGCP_TRANSAC_MANAGER pTranMng, MGCP_STACK_MSG *pMSG);


#ifdef __cplusplus}#endif

#endif


⌨️ 快捷键说明

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