tlv_encode(3)

tlv_encode3

Tlv manipulation functions

Part of tlv(3).

Usage

#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);

Library

Mifare card manipulation library (libfreefare, -lfreefare)

Overview

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.

Return values

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

Releases

Unchanged in 6 releases since Debian 8 (Jessie).

  1. 8–13

Authors

Romain Tartiere ⟨[email protected]⟩ Romuald Conty ⟨[email protected]⟩

From libfreefare-doc 0.4.0-2.3 in Debian 13 (Trixie). Parsed by carta from the page's mdoc source.