tlv_encode, tlv_decode — TLV Manipulation Functions
Contents
Description
The tlv_encode() and tlv_decode() functions are helpers to manipulate TLV (Text-Length-Value) data.
The tlv_encode() function converts the isize bytes long istream message into a TLV stream of type type
and set the value of osize to the length of the returned stream.
The tlv_decode() function converts the istream TLV stream and set the type argument according to the type
of the stream, and set the size argument to the length of the returned stream.
Library
Mifare card manipulation library (libfreefare, -lfreefare)
Name
tlv_encode, tlv_decode — TLV Manipulation Functions
Return Values
Both functions return memory allocated using malloc(3) which should be reclaimed using free(3) after
usage.
See Also
freefare(3), malloc(3), free(3)
Synopsis
#include<freefare.h>uint8_t*tlv_encode(constuint8_ttype, constuint8_t*istream, uint16_tisize, size_t*osize);
uint8_t*tlv_decode(constuint8_t*istream, uint8_t*type, uint16_t*size);
