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

Functions

int name_component_tlv_decode (ndn_decoder_t *decoder, name_component_t *component)
 Decode the Name Component from wire format (TLV block). More...
 
int name_component_from_block (name_component_t *component, const name_component_block_t *block)
 Decode an Name Component TLV block into an Name Component. More...
 
int name_component_compare (const name_component_t *lhs, const name_component_t *rhs)
 Compare two name components. More...
 
int name_component_tlv_encode (ndn_encoder_t *encoder, const name_component_t *component)
 Encode the Name Component structure into wire format (TLV block). More...
 

Function Documentation

◆ name_component_compare()

int name_component_compare ( const name_component_t lhs,
const name_component_t rhs 
)

Compare two name components.

Parameters
lhs.Input. Left-hand-side name component.
rhs.Input. Right-hand-side name component.
Returns
0 if lhs == rhs.

◆ name_component_from_block()

int name_component_from_block ( name_component_t component,
const name_component_block_t block 
)

Decode an Name Component TLV block into an Name Component.

This function will do memory copy.

Parameters
component.Output. The component to which the TLV block will be decoded.
block.Input. The Name Component TLV.
Returns
0 if decoding is successful.

◆ name_component_tlv_decode()

int name_component_tlv_decode ( ndn_decoder_t decoder,
name_component_t component 
)

Decode the Name Component from wire format (TLV block).

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

◆ name_component_tlv_encode()

int name_component_tlv_encode ( ndn_encoder_t encoder,
const name_component_t component 
)

Encode the Name Component structure into wire format (TLV block).

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