15#define DISABLE_DEBUGLOG
19#include <gwenhywfar/debug.h>
20#include <gwenhywfar/inherit.h>
21#include <gwenhywfar/misc.h>
22#include <gwenhywfar/text.h>
67 return tlv->tagLength;
92 unsigned int tagLength;
115 DBG_ERROR(0,
"Too few bytes for BER-TLV");
118 j=(
unsigned char)(p[pos]);
127 j=((
unsigned char)(p[pos+1]))<<8;
128 j|=(
unsigned char)(p[pos]);
136 tlv->tagType=tagType;
137 tlv->tagLength=tagLength;
139 tlv->tagData=(
void *)malloc(tagLength);
140 memmove(tlv->tagData, tagData, tagLength);
153 unsigned int tagType;
154 unsigned int tagLength;
155 const uint8_t *tagData;
176 j=(
unsigned char)(p[pos]);
185 j=((
unsigned char)(p[pos+1]))<<8;
186 j|=(
unsigned char)(p[pos]);
193 tlv->tagType=tagType;
194 tlv->tagLength=tagLength;
197 tlv->tagData=(
void *)malloc(tagLength);
198 memmove(tlv->tagData, tagData, tagLength);
202 tlv->tagData=(uint8_t *)tagData;
207 tlv->tagSize=tagLength+3;
int GWEN_Buffer_IncrementPos(GWEN_BUFFER *bf, uint32_t i)
uint32_t GWEN_Buffer_GetBytesLeft(GWEN_BUFFER *bf)
char * GWEN_Buffer_GetPosPointer(const GWEN_BUFFER *bf)
int GWEN_Buffer_AppendBytes(GWEN_BUFFER *bf, const char *buffer, uint32_t size)
uint32_t GWEN_Buffer_GetPos(const GWEN_BUFFER *bf)
int GWEN_Buffer_AppendByte(GWEN_BUFFER *bf, char c)
#define DBG_ERROR(dbg_logger, format, args...)
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
#define GWEN_LIST_FINI(t, element)
#define GWEN_LIST_FUNCTIONS(t, pr)
#define GWEN_LIST_INIT(t, element)
#define GWEN_FREE_OBJECT(varname)
#define GWEN_NEW_OBJECT(typ, varname)
GWEN_TAG16 * GWEN_Tag16_new(void)
void GWEN_Tag16_DirectlyToBuffer(unsigned int tagType, const char *p, int size, GWEN_BUFFER *buf)
GWEN_TAG16 * GWEN_Tag16_fromBuffer(GWEN_BUFFER *mbuf, GWEN_UNUSED int isBerTlv)
GWEN_TAG16 * GWEN_Tag16_fromBuffer2(const uint8_t *p, uint32_t l, int doCopy)
const void * GWEN_Tag16_GetTagData(const GWEN_TAG16 *tlv)
unsigned int GWEN_Tag16_GetTagType(const GWEN_TAG16 *tlv)
unsigned int GWEN_Tag16_GetTagLength(const GWEN_TAG16 *tlv)
void GWEN_Tag16_free(GWEN_TAG16 *tlv)
unsigned int GWEN_Tag16_GetTagSize(const GWEN_TAG16 *tlv)
struct GWEN_TAG16 GWEN_TAG16