DOKK / manpages / debian 12 / libfreefare-doc / tlv.3.en
TLV(3) Library Functions Manual TLV(3)

tlv_encode, tlv_decodeTLV Manipulation Functions

Mifare card manipulation library (libfreefare, -lfreefare)

#include <freefare.h>

uint8_t *
tlv_encode(const uint8_t type, const uint8_t *istream, uint16_t isize, size_t *osize);

uint8_t *
tlv_decode(const uint8_t *istream, uint8_t *type, uint16_t *size);

The () and tlv_decode() functions are helpers to manipulate TLV (Text-Length-Value) data.

The () 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 () 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.

Both functions return memory allocated using malloc(3) which should be reclaimed using free(3) after usage.

freefare(3), malloc(3), free(3)

Romain Tartiere ⟨romain@blogreen.org⟩
Romuald Conty ⟨romuald@libnfc.org⟩

March 30, 2010 Debian