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

📄 ospauthrsp.c

📁 radius协议源码÷The Radius Stack will connect to a Radius Server. This stack implementation is built upo
💻 C
📖 第 1 页 / 共 2 页
字号:
/**########################################################################*########################################################################*########################################################################*                                                               *   COPYRIGHT (c) 1998, 1999 by TransNexus, LLC                          *                                                                    *   This software contains proprietary and confidential information  *   of TransNexus, LLC. Except as may be set forth in the license    *   agreement under which this software is supplied, use, disclosure, *   or reproduction is prohibited without the prior, express, written*   consent of TransNexus, LLC.                                      *                                     *******#########################################################################*#########################################################################*#########################################################################*//* * ospauthrsp.c - OSP authorisation response functions */#include "osp.h"#include "osperrno.h"#include "ospbfr.h"#include "osplist.h"#include "ospxmlattr.h"#include "ospxmlelem.h"#include "ospmsgattr.h"#include "ospmsgelem.h"#include "ospdest.h"#include "ospauthrsp.h"#include "ospstatus.h"#include "osputils.h"#ifdef OSPC_DEBUG/**//*-----------------------------------------------------------------------* * OSPPAuthRspSetTimestamp() - sets the timestamp for an authorisation response *-----------------------------------------------------------------------*/void                                       /* nothing returned */OSPPAuthRspSetTimestamp(    OSPTAUTHRSP *ospvAuthRsp,    OSPTTIME  ospvTime){    if (ospvAuthRsp != OSPC_OSNULL)    {        (ospvAuthRsp)->ospmAuthRspTimestamp = (ospvTime);    }}/**//*-----------------------------------------------------------------------* * OSPPAuthRspHasStatus() - does the authorisation response have * a status? *-----------------------------------------------------------------------*/unsigned                            /* returns non-zero if number exists */OSPPAuthRspHasStatus(    OSPTAUTHRSP *ospvAuthRsp        /* authorisation response effected */){    unsigned ospvHasStatus = OSPC_FALSE;    if(ospvAuthRsp != OSPC_OSNULL)    {        ospvHasStatus = ((ospvAuthRsp)->ospmAuthRspStatus != OSPC_OSNULL);    }    return(ospvHasStatus);}/**//*-----------------------------------------------------------------------* * OSPPAuthRspGetStatus() - returns the status for an  * authorisation response *-----------------------------------------------------------------------*/OSPTSTATUS *                                 /* returns pointer to status */    OSPPAuthRspGetStatus(    OSPTAUTHRSP *ospvAuthRsp               /* authorisation response */    ){    OSPTSTATUS *ospvStatus = OSPC_OSNULL;    if (ospvAuthRsp != OSPC_OSNULL)    {        ospvStatus = (ospvAuthRsp)->ospmAuthRspStatus;    }    return(ospvStatus);}/**//*-----------------------------------------------------------------------* * OSPPAuthRspSetTrxId() - sets the transaction ID for an authorisation *-----------------------------------------------------------------------*/void                                       /* nothing returned */OSPPAuthRspSetTrxId(    OSPTAUTHRSP   *ospvAuthRsp,            /* authorisation response */    OSPTTRXID ospvTrxId                 /* transaction ID to set */){    if(ospvAuthRsp != OSPC_OSNULL)    {        (ospvAuthRsp)->ospmAuthRspTrxId = ospvTrxId;    }}/**//*-----------------------------------------------------------------------* * OSPPAuthRspHasDest() - does the authorisation response have * a destination? *-----------------------------------------------------------------------*/unsigned                            /* returns non-zero if number exists */OSPPAuthRspHasDest(    OSPTAUTHRSP *ospvAuthRsp        /* authorisation response effected */){    unsigned ospvHasDest = OSPC_FALSE;    if (ospvAuthRsp != OSPC_OSNULL)    {        ospvHasDest = ((ospvAuthRsp)->ospmAuthRspDest != OSPC_OSNULL);    }    return(ospvHasDest);}/**//*-----------------------------------------------------------------------* * OSPPAuthRspFirstDest() - returns the first destination for an  * authorisation response *-----------------------------------------------------------------------*/OSPTDEST *                                 /* returns pointer to dest */    OSPPAuthRspFirstDest(    OSPTAUTHRSP *ospvAuthRsp               /* authorisation response */    ){    OSPTDEST *dest = OSPC_OSNULL;    if (ospvAuthRsp != OSPC_OSNULL)    {        dest = (OSPTDEST *)OSPPListFirst(&(ospvAuthRsp->ospmAuthRspDest));    }    return(dest);}/**//*-----------------------------------------------------------------------* * OSPPAuthRspNextDest() - returns the next destination for an  * authorisation response *-----------------------------------------------------------------------*/OSPTDEST *                                 /* returns pointer to dest */    OSPPAuthRspNextDest(    OSPTAUTHRSP *ospvAuthRsp,               /* authorisation response */    OSPTDEST    *ospvDest    ){    OSPTDEST *dest = (OSPTDEST *)OSPC_OSNULL;    if (ospvAuthRsp != (OSPTAUTHRSP *)OSPC_OSNULL)    {        dest = (OSPTDEST *)OSPPListNext(&(ospvAuthRsp->ospmAuthRspDest), ospvDest);    }    return dest;}/**//*-----------------------------------------------------------------------* * OSPPAuthRspHasTNDelayLimit() - does an auth response have delay limit? *-----------------------------------------------------------------------*/unsigned                                   /* returns non-zero if exists */OSPPAuthRspHasTNDelayLimit(    OSPTAUTHRSP *ospvAuthRsp                  /* authorisation response */){    unsigned ospvHasTNDelayLimit = OSPC_FALSE;    if(ospvAuthRsp != OSPC_OSNULL)    {        ospvHasTNDelayLimit = ((ospvAuthRsp)->ospmAuthRspTNDelayLimit > 0);    }    return(ospvHasTNDelayLimit);}/**//*-----------------------------------------------------------------------* * OSPPAuthRspSetTNDelayLimit() - sets the delay limit for an authorisation *-----------------------------------------------------------------------*/void                                       /* nothing returned */OSPPAuthRspSetTNDelayLimit(    OSPTAUTHRSP   *ospvAuthRsp,            /* authorisation response */    unsigned ospvTNDelayLimit              /* delay limit to set */){    if(ospvAuthRsp != OSPC_OSNULL)    {        (ospvAuthRsp)->ospmAuthRspTNDelayLimit = ospvTNDelayLimit;    }}/**//*-----------------------------------------------------------------------* * OSPPAuthRspGetTNDelayLimit() - gets the delay limit for an auth response *-----------------------------------------------------------------------*/unsigned                                /* returns transaction ID pointer */    OSPPAuthRspGetTNDelayLimit(    OSPTAUTHRSP *ospvAuthRsp               /* authorisation response */    ){    unsigned ospvTNDelayLimit = 0;    if (ospvAuthRsp != OSPC_OSNULL)    {        ospvTNDelayLimit = ((ospvAuthRsp)->ospmAuthRspTNDelayLimit);    }    return(ospvTNDelayLimit);}/**//*-----------------------------------------------------------------------* * OSPPAuthRspHasTNDelayPref() - does an auth response have delay pref? *-----------------------------------------------------------------------*/unsigned                                   /* returns non-zero if exists */OSPPAuthRspHasTNDelayPref(    OSPTAUTHRSP *ospvAuthRsp                  /* authorisation response */){    unsigned ospvHasTNDelayPref = OSPC_FALSE;    if(ospvAuthRsp != OSPC_OSNULL)    {        ospvHasTNDelayPref = ((ospvAuthRsp)->ospmAuthRspTNDelayPref > 0);    }    return(ospvHasTNDelayPref);}/**//*-----------------------------------------------------------------------* * OSPPAuthRspSetTNDelayPref() - sets the delay pref for an authorisation *-----------------------------------------------------------------------*/void                                       /* nothing returned */OSPPAuthRspSetTNDelayPref(    OSPTAUTHRSP   *ospvAuthRsp,           /* authorisation response */    unsigned ospvTNDelayPref              /* delay pref to set */){    if(ospvAuthRsp != OSPC_OSNULL)    {        (ospvAuthRsp)->ospmAuthRspTNDelayPref = ospvTNDelayPref;    }}unsignedOSPPAuthRspHasNumDests(    OSPTAUTHRSP *ospvAuthRsp){    if(ospvAuthRsp != OSPC_OSNULL)    {        return ospvAuthRsp->ospmNumDests;    }    else    {        return 0;    }}voidOSPPAuthRspIncNumDests(    OSPTAUTHRSP *ospvAuthRsp){    if(ospvAuthRsp != OSPC_OSNULL)    {        ospvAuthRsp->ospmNumDests++;    }    return;}unsignedOSPPAuthRspGetNumDests(    OSPTAUTHRSP *ospvAuthRsp){    if(ospvAuthRsp != OSPC_OSNULL)    {        return ospvAuthRsp->ospmNumDests;    }

⌨️ 快捷键说明

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