15#define DISABLE_DEBUGLOG
20#include <gwenhywfar/misc.h>
21#include <gwenhywfar/debug.h>
22#include <gwenhywfar/tag16.h>
45 if (st->pSignature && st->lSignature)
71 const char *subtagPtr;
83 if (subtagLen && subtagPtr) {
85 case GWEN_SIGTAIL_TLV_SIGNATURE:
86 st->pSignature=(uint8_t *)malloc(subtagLen);
87 memmove(st->pSignature, subtagPtr, subtagLen);
88 st->lSignature=subtagLen;
91 case GWEN_SIGTAIL_TLV_SIGNUM:
92 if (sscanf(subtagPtr,
"%d", &i)==1)
93 st->signatureNumber=i;
124 if (st->pSignature && st->lSignature)
126 (
const char *)st->pSignature,
130 snprintf(numbuf,
sizeof(numbuf),
"%d", st->signatureNumber);
147 return st->pSignature;
155 return st->lSignature;
163 if (st->pSignature && st->lSignature)
164 free(st->pSignature);
166 st->pSignature=(uint8_t *)malloc(l);
167 memmove(st->pSignature, p, l);
181 return st->signatureNumber;
189 st->signatureNumber=i;
uint32_t GWEN_Buffer_GetPos(const GWEN_BUFFER *bf)
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
int GWEN_Buffer_AppendByte(GWEN_BUFFER *bf, char c)
#define DBG_WARN(dbg_logger, format, args...)
#define DBG_INFO(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)
void GWEN_SigTail_SetSignatureNumber(GWEN_SIGTAIL *st, int i)
GWEN_SIGTAIL * GWEN_SigTail_fromBuffer(const uint8_t *p, uint32_t l)
GWEN_SIGTAIL * GWEN_SigTail_new(void)
void GWEN_SigTail_SetSignature(GWEN_SIGTAIL *st, const uint8_t *p, uint32_t l)
const uint8_t * GWEN_SigTail_GetSignaturePtr(const GWEN_SIGTAIL *st)
int GWEN_SigTail_GetSignatureNumber(const GWEN_SIGTAIL *st)
void GWEN_SigTail_free(GWEN_SIGTAIL *st)
uint32_t GWEN_SigTail_GetSignatureLen(const GWEN_SIGTAIL *st)
int GWEN_SigTail_toBuffer(const GWEN_SIGTAIL *st, GWEN_BUFFER *buf, uint8_t tagType)
struct GWEN_SIGTAIL GWEN_SIGTAIL
void GWEN_Tag16_DirectlyToBuffer(unsigned int tagType, const char *p, int size, GWEN_BUFFER *buf)
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