tlv.h
Go to the documentation of this file.
/***************************************************************************
begin : Sun Jun 13 2004
copyright : (C) 2004-2011 by Martin Preuss
email : martin@libchipcard.de
***************************************************************************
* Please see toplevel file COPYING for license details *
***************************************************************************/
#ifndef GWENHYWFAR_TLV_H
#define GWENHYWFAR_TLV_H
#include <gwenhywfar/buffer.h>
#include <gwenhywfar/misc.h>
#include <gwenhywfar/db.h>
typedef struct GWEN_TLV GWEN_TLV;
GWEN_LIST_FUNCTION_LIB_DEFS(GWEN_TLV, GWEN_TLV, GWENHYWFAR_API)
GWENHYWFAR_API
GWEN_TLV *GWEN_TLV_new(void);
GWENHYWFAR_API
void GWEN_TLV_free(GWEN_TLV *tlv);
GWENHYWFAR_API
GWEN_TLV *GWEN_TLV_create(unsigned int tagType,
unsigned int tagMode,
const void *p,
unsigned int dlen,
int isBerTlv);
GWENHYWFAR_API
GWEN_TLV *GWEN_TLV_fromBuffer(GWEN_BUFFER *mbuf, int isBerTlv);
GWENHYWFAR_API
int GWEN_TLV_toBuffer(GWEN_TLV *tlv, GWEN_BUFFER *mbuf);
GWENHYWFAR_API
int GWEN_TLV_DirectlyToBuffer(unsigned int tagType,
unsigned int tagMode,
const void *tagData,
int tagLength,
int isBerTlv,
GWEN_BUFFER *mbuf);
GWENHYWFAR_API
int GWEN_TLV_IsBerTlv(const GWEN_TLV *tlv);
GWENHYWFAR_API
unsigned int GWEN_TLV_GetTagType(const GWEN_TLV *tlv);
GWENHYWFAR_API
unsigned int GWEN_TLV_GetTagLength(const GWEN_TLV *tlv);
GWENHYWFAR_API
const void *GWEN_TLV_GetTagData(const GWEN_TLV *tlv);
GWENHYWFAR_API
int GWEN_TLV_IsContructed(const GWEN_TLV *tlv);
GWENHYWFAR_API
unsigned int GWEN_TLV_GetClass(const GWEN_TLV *tlv);
GWENHYWFAR_API
unsigned int GWEN_TLV_GetTagSize(const GWEN_TLV *tlv);
GWENHYWFAR_API
int GWEN_TLV_ReadHeader(GWEN_TLV *tlv, const uint8_t *p, uint32_t size, int isBerTlv);
GWENHYWFAR_API
int GWEN_TLV_WriteHeader(unsigned int tagType,
unsigned int tagMode,
uint64_t tagLength,
int isBerTlv,
GWEN_BUFFER *mbuf);
GWENHYWFAR_API
int GWEN_TLV_Buffer_To_DB(GWEN_DB_NODE *dbRecord, GWEN_BUFFER *mbuf, int len);
GWENHYWFAR_API
uint32_t GWEN_TLV_ParseLength(GWEN_BUFFER *mbuf, uint32_t *tag_len_len);
#endif /* GWENHYWFAR_TLV_H */
buffer.h
db.h
GWEN_DB_NODE
struct GWEN_DB_NODE GWEN_DB_NODE
Definition db.h:228
GWEN_BUFFER
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
Definition buffer.h:38
GWENHYWFAR_API
#define GWENHYWFAR_API
Definition gwenhywfarapi.h:67
GWEN_LIST_FUNCTION_LIB_DEFS
#define GWEN_LIST_FUNCTION_LIB_DEFS(t, pr, decl)
Definition list1.h:349
misc.h
GWEN_TLV_ReadHeader
GWENHYWFAR_API int GWEN_TLV_ReadHeader(GWEN_TLV *tlv, const uint8_t *p, uint32_t size, int isBerTlv)
GWEN_TLV_toBuffer
GWENHYWFAR_API int GWEN_TLV_toBuffer(GWEN_TLV *tlv, GWEN_BUFFER *mbuf)
GWEN_TLV_GetTagLength
GWENHYWFAR_API unsigned int GWEN_TLV_GetTagLength(const GWEN_TLV *tlv)
GWEN_TLV_free
GWENHYWFAR_API void GWEN_TLV_free(GWEN_TLV *tlv)
GWEN_TLV_GetTagData
GWENHYWFAR_API const void * GWEN_TLV_GetTagData(const GWEN_TLV *tlv)
GWEN_TLV_GetTagType
GWENHYWFAR_API unsigned int GWEN_TLV_GetTagType(const GWEN_TLV *tlv)
GWEN_TLV_IsContructed
GWENHYWFAR_API int GWEN_TLV_IsContructed(const GWEN_TLV *tlv)
GWEN_TLV_Buffer_To_DB
GWENHYWFAR_API int GWEN_TLV_Buffer_To_DB(GWEN_DB_NODE *dbRecord, GWEN_BUFFER *mbuf, int len)
GWEN_TLV_IsBerTlv
GWENHYWFAR_API int GWEN_TLV_IsBerTlv(const GWEN_TLV *tlv)
GWEN_TLV_ParseLength
GWENHYWFAR_API uint32_t GWEN_TLV_ParseLength(GWEN_BUFFER *mbuf, uint32_t *tag_len_len)
GWEN_TLV
struct GWEN_TLV GWEN_TLV
Definition tlv.h:19
GWEN_TLV_create
GWENHYWFAR_API GWEN_TLV * GWEN_TLV_create(unsigned int tagType, unsigned int tagMode, const void *p, unsigned int dlen, int isBerTlv)
GWEN_TLV_fromBuffer
GWENHYWFAR_API GWEN_TLV * GWEN_TLV_fromBuffer(GWEN_BUFFER *mbuf, int isBerTlv)
GWEN_TLV_new
GWENHYWFAR_API GWEN_TLV * GWEN_TLV_new(void)
GWEN_TLV_DirectlyToBuffer
GWENHYWFAR_API int GWEN_TLV_DirectlyToBuffer(unsigned int tagType, unsigned int tagMode, const void *tagData, int tagLength, int isBerTlv, GWEN_BUFFER *mbuf)
GWEN_TLV_GetClass
GWENHYWFAR_API unsigned int GWEN_TLV_GetClass(const GWEN_TLV *tlv)
GWEN_TLV_GetTagSize
GWENHYWFAR_API unsigned int GWEN_TLV_GetTagSize(const GWEN_TLV *tlv)
GWEN_TLV_WriteHeader
GWENHYWFAR_API int GWEN_TLV_WriteHeader(unsigned int tagType, unsigned int tagMode, uint64_t tagLength, int isBerTlv, GWEN_BUFFER *mbuf)