ndn-lite
Functions
metainfo.c File Reference
#include "metainfo.h"

Functions

int ndn_metainfo_tlv_decode (ndn_decoder_t *decoder, ndn_metainfo_t *meta)
 Decode the Metainfo from wire format (TLV block). More...
 
int ndn_metainfo_from_tlv_block (ndn_metainfo_t *meta, const uint8_t *block_value, uint32_t block_size)
 Decode a Metainfo TLV block into a ndn_metainfo_t. More...
 
int ndn_metainfo_tlv_encode (ndn_encoder_t *encoder, const ndn_metainfo_t *meta)
 Encode the Metainfo structure into wire format (TLV block). More...
 

Function Documentation

◆ ndn_metainfo_from_tlv_block()

int ndn_metainfo_from_tlv_block ( ndn_metainfo_t meta,
const uint8_t *  block_value,
uint32_t  block_size 
)

Decode a Metainfo TLV block into a ndn_metainfo_t.

Parameters
meta.Output. The Metainfo to which the TLV block will be decoded.
block_value.Input. The Metainfo TLV block buffer.
block_size.Input. The size of the Metainfo TLV block buffer.
Returns
0 if decoding is successful.

◆ ndn_metainfo_tlv_decode()

int ndn_metainfo_tlv_decode ( ndn_decoder_t decoder,
ndn_metainfo_t meta 
)

Decode the Metainfo from wire format (TLV block).

Parameters
decoder.Input. The decoder who keeps the decoding result and the state.
meta.Output. The Metainfo decoded from TLV block.
Returns
0 if there is no error.

◆ ndn_metainfo_tlv_encode()

int ndn_metainfo_tlv_encode ( ndn_encoder_t encoder,
const ndn_metainfo_t meta 
)

Encode the Metainfo structure into wire format (TLV block).

Parameters
encoder.Output. The encoder who keeps the encoding result and the state.
meta.Input. The Metainfo structure to be encoded.
Returns
0 if there is no error.