15 #define DISABLE_DEBUGLOG
19 #include <gwenhywfar/debug.h>
20 #include <gwenhywfar/inherit.h>
21 #include <gwenhywfar/misc.h>
22 #include <gwenhywfar/text.h>
63 return tlv->tagLength;
86 unsigned int tagLength;
101 tagMode=tagType=tagLength=0;
109 DBG_ERROR(0,
"Too few bytes for BER-TLV");
112 j=(
unsigned char)(p[pos]);
121 j=((
unsigned char)(p[pos+1]))<<8;
122 j|=(
unsigned char)(p[pos]);
130 tlv->tagType=tagType;
131 tlv->tagLength=tagLength;
133 tlv->tagData=(
void*)malloc(tagLength);
134 memmove(tlv->tagData, tagData, tagLength);
146 unsigned int tagType;
147 unsigned int tagLength;
148 const uint8_t *tagData;
169 j=(
unsigned char)(p[pos]);
178 j=((
unsigned char)(p[pos+1]))<<8;
179 j|=(
unsigned char)(p[pos]);
186 tlv->tagType=tagType;
187 tlv->tagLength=tagLength;
190 tlv->tagData=(
void*)malloc(tagLength);
191 memmove(tlv->tagData, tagData, tagLength);
195 tlv->tagData=(uint8_t*)tagData;
200 tlv->tagSize=tagLength+3;