1
/**************************************************************************
2
*** COPYRIGHT (c) 2002 by TransNexus, Inc. ***
4
*** This software is property of TransNexus, Inc. ***
5
*** This software is freely available under license from TransNexus. ***
6
*** The license terms and conditions for free use of this software by ***
7
*** third parties are defined in the OSP Toolkit Software License ***
8
*** Agreement (LICENSE.txt). Any use of this software by third ***
9
*** parties, which does not comply with the terms and conditions of the ***
10
*** OSP Toolkit Software License Agreement is prohibited without ***
11
*** the prior, express, written consent of TransNexus, Inc. ***
13
*** Thank you for using the OSP ToolKit(TM). Please report any bugs, ***
14
*** suggestions or feedback to support@transnexus.com ***
16
**************************************************************************/
25
* ospasn1ids.c - ASN1 defined ID's definitions and functions.
28
#define OSPC_OSPASN1ID_INCLUDE_STATIC 1 /* Forces inclusion of static */
29
/* data defined in ospasn1id.h */
31
#include "osp/ospasn1.h"
32
#include "osp/ospasn1ids.h"
35
/* FUNCTION PROTOTYPES */
37
/* ---------------------------------------------------------*/
38
/* Member functions */
39
/* ---------------------------------------------------------*/
44
unsigned char **ospvIdValue,
45
unsigned *ospvIdLength)
47
int errorcode = OSPC_ERR_NO_ERROR;
48
OSPTIDINDEX *idxRec = OSPC_OSNULL;
50
if ((ospvId < 0) || (ospvId > OSPEID_LISTEND))
52
errorcode = OSPC_ERR_ASN1_OBJECTID_NOT_FOUND;
53
OSPM_DBGERRORLOG(errorcode, "Object Id enum out of range");
55
else if (ospvIdValue == OSPC_OSNULL)
57
errorcode = OSPC_ERR_ASN1_NULL_POINTER;
58
OSPM_DBGERRORLOG(errorcode,
59
"Invalid Null Pointer provided for object Id return");
62
if (errorcode == OSPC_ERR_NO_ERROR)
64
idxRec = &(ospgASN1IDIndex[ospvId]);
65
if (idxRec->Id != ospvId)
67
errorcode = OSPC_ERR_ASN1_OBJECTID_MISMATCH;
68
OSPM_DBGERRORLOG(errorcode,
69
"ID definitions and reference enums are out-of-sync");
73
if (errorcode == OSPC_ERR_NO_ERROR)
75
*ospvIdValue = idxRec->Value;
76
*ospvIdLength = idxRec->ValueLength;
79
if (errorcode != OSPC_ERR_NO_ERROR)
81
*ospvIdValue = OSPC_OSNULL;