📄 ospauthind.h
字号:
/**########################################################################*########################################################################*########################################################################* * 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. * *******#########################################################################*#########################################################################*#########################################################################*//* * ospauthind.h - OSP authorisation indication objects */#ifndef _OSPAUTHIND_H#define _OSPAUTHIND_H#include "osp.h"#include "ospxmlelem.h"#include "ospmsg.h"#include "ospcallid.h"#include "osptoken.h"#include "ospaltinfo.h"#include "ospdest.h"typedef struct{ OSPTTIME ospmAuthIndTimestamp; unsigned ospmAuthIndRole; unsigned ospmAuthIndHasRole; OSPTCALLID *ospmAuthIndCallId; unsigned char ospmAuthIndSourceNumber[OSPC_E164NUMSIZE]; unsigned char ospmAuthIndDestNumber[OSPC_E164NUMSIZE]; OSPTLIST ospmAuthIndSourceAlternate; OSPTLIST ospmAuthIndDestinationAlternate; OSPTLIST ospmAuthIndTokens; OSPTBOOL ospmAuthIndHasTimeLimit; unsigned ospmAuthIndTimeLimit; OSPTDEST *ospmAuthIndDest;}OSPTAUTHIND;/**//*-----------------------------------------------------------------------* * macros that emulate functions *-----------------------------------------------------------------------*//* * Note: all macros are also implemented as functions in ospauthind.c. * For implementation details, see the comments in that file. To replace * a macro with a true function, simply comment out the macro definition * below. */#ifndef OSPC_DEBUG#define OSPPAuthIndFirstDestinationAlt(ospvAuthInd) \ (const char *)OSPPListFirst(&((ospvAuthInd)->ospmAuthIndDestinationAlternate))#define OSPPAuthIndFirstSourceAlt(ospvAuthInd) \ (const char *)OSPPListFirst(&((ospvAuthInd)->ospmAuthIndSourceAlternate))#define OSPPAuthIndGetCallId(ospvAuthInd) \ ((ospvAuthInd)->ospmAuthIndCallId)#define OSPPAuthIndGetCallIdSize(ospvAuthInd) \ OSPPCallIdGetSize(((ospvAuthInd)->ospmAuthIndCallId))#define OSPPAuthIndGetCallIdValue(ospvAuthInd) \ OSPPCallIdGetValue(((ospvAuthInd)->ospmAuthIndCallId))#define OSPPAuthIndGetDestinationAltValue(ospvAltInfo) \ OSPPAltInfoGetValue(ospvAltInfo)#define OSPPAuthIndGetDestNumber(ospvAuthInd) \ ((ospvAuthInd)->ospmAuthIndDestNumber)#define OSPPAuthIndGetSourceAltValue(ospvAltInfo) \ OSPPAltInfoGetValue(ospvAltInfo)#define OSPPAuthIndGetSourceNumber(ospvAuthInd) \ (ospvAuthInd->ospmAuthIndSourceNumber)#define OSPPAuthIndHasCallId(ospvAuthInd) \ ((ospvAuthInd)->ospmAuthIndCallId != OSPC_OSNULL)#define OSPPAuthIndHasDestinationAlt(ospvAuthInd) \ (OSPPAuthIndFirstDestinationAlt(ospvAuthInd) != OSPC_OSNULL)#define OSPPAuthIndHasDestNumber(ospvAuthInd) \ ((ospvAuthInd)->ospmAuthIndDestNumber[0] != '\0')#define OSPPAuthIndHasDest(ospvAuthInd) \ (ospvAuthInd->ospmAuthIndDest != OSPC_OSNULL)#define OSPPAuthIndHasSourceAlt(ospvAuthInd) \ (OSPPAuthIndFirstSourceAlt(ospvAuthInd) != OSPC_OSNULL)#define OSPPAuthIndHasSourceNumber(ospvAuthInd) \ ((ospvAuthInd)->ospmAuthIndSourceNumber[0] != '\0')#define OSPPAuthIndNextDestinationAlt(ospvAuthInd, ospvAltInfo) \ (OSPTALTINFO *)OSPPListNext((OSPTLIST *)&((ospvAuthInd)->ospmAuthIndDestinationAlternate), \ (void *)ospvAltInfo)#define OSPPAuthIndNextSourceAlt(ospvAuthInd, ospvAltInfo) \ (OSPTALTINFO *)OSPPListNext((OSPTLIST *)&((ospvAuthInd)->ospmAuthIndSourceAlternate), \ (void *)ospvAltInfo)#define OSPPAuthIndSetDest(ospvAuthInd, ospvDest)\if ( OSPPAuthIndHasDest( ospvAuthInd ) == OSPC_TRUE ) \{ \ OSPPDestDelete( &(ospvAuthInd->ospmAuthIndDest ) ); \} \ospvAuthInd->ospmAuthIndDest = ospvDest;#define OSPPAuthIndSetDestNumber(ospvAuthInd,ospvNum) \ OSPM_STRNCPY((ospvAuthInd)->ospmAuthIndDestNumber, (ospvNum), \ osp_min(OSPM_STRLEN((const char *)ospvNum)+1,OSPC_E164NUMSIZE-1))#define OSPPAuthIndSetRole(ospvAuthInd,ospvRole) \ (ospvAuthInd)->ospmAuthIndRole = (ospvRole); \ (ospvAuthInd)->ospmAuthIndHasRole = OSPC_TRUE;#define OSPPAuthIndSetSourceNumber(ospvAuthInd,ospvNum) \ OSPM_STRNCPY((ospvAuthInd)->ospmAuthIndSourceNumber, (ospvNum), \ osp_min(OSPM_STRLEN((const char *)ospvNum)+1,OSPC_E164NUMSIZE-1))#define OSPPAuthIndSetTimestamp(ospvAuthInd,ospvTime) \ (ospvAuthInd)->ospmAuthIndTimestamp = (ospvTime)#endif #define OSPPAuthIndTokenGetSize(ospvToken) OSPPTokenGetSize(ospvToken);#define OSPPAuthIndTokenGetValue(ospvToken) OSPPTokenGetValue(ospvToken);/**//*-----------------------------------------------------------------------* * function prototypes *-----------------------------------------------------------------------*/#ifdef __cplusplusextern "C" {#endif void OSPPAuthIndDelete(OSPTAUTHIND **); OSPTAUTHIND *OSPPAuthIndNew(void); void OSPPAuthIndSetCallId(OSPTAUTHIND *, OSPTCALLID *);#ifdef OSPC_DEBUG void OSPPAuthIndSetTimestamp(OSPTAUTHIND *, OSPTTIME); void OSPPAuthIndSetRole(OSPTAUTHIND *, unsigned); unsigned OSPPAuthIndHasCallId(OSPTAUTHIND *); OSPTCALLID *OSPPAuthIndGetCallId(OSPTAUTHIND *); unsigned OSPPAuthIndGetCallIdSize(OSPTAUTHIND *); unsigned char *OSPPAuthIndGetCallIdValue(OSPTAUTHIND *); unsigned OSPPAuthIndHasSourceNumber(OSPTAUTHIND *ospvAuthInd); void OSPPAuthIndSetSourceNumber(OSPTAUTHIND *, const unsigned char *); unsigned char *OSPPAuthIndGetSourceNumber(OSPTAUTHIND *); unsigned OSPPAuthIndHasDestNumber(OSPTAUTHIND *ospvAuthInd); void OSPPAuthIndSetDestNumber(OSPTAUTHIND *, const unsigned char *); unsigned char *OSPPAuthIndGetDestNumber(OSPTAUTHIND *); void OSPPAuthIndSetDest(OSPTAUTHIND *, OSPTDEST *); unsigned OSPPAuthIndHasDest(OSPTAUTHIND *); unsigned OSPPAuthIndHasSourceAlt(OSPTAUTHIND *); OSPTALTINFO *OSPPAuthIndFirstSourceAlt(OSPTAUTHIND *); OSPTALTINFO *OSPPAuthIndNextSourceAlt(OSPTAUTHIND *, OSPTALTINFO *); unsigned char *OSPPAuthIndGetSourceAltValue(OSPTALTINFO *); unsigned OSPPAuthIndHasDestinationAlt(OSPTAUTHIND *); unsigned OSPPAuthIndGetDestinationAltSize(OSPTALTINFO *); OSPTALTINFO *OSPPAuthIndFirstDestinationAlt(OSPTAUTHIND *); OSPTALTINFO *OSPPAuthIndNextDestinationAlt(OSPTAUTHIND *, OSPTALTINFO *); unsigned char *OSPPAuthIndGetDestinationAltValue(OSPTALTINFO *);#endif /* OSPC_DEBUG */ void OSPPAuthIndSetTimeLimit(OSPTAUTHIND *, unsigned);#ifdef __cplusplus}#endif#endif /* _OSPCAUTHIND_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -