![]() |
ndn-lite
|
#include "encoder.h"
Go to the source code of this file.
Data Structures | |
struct | ndn_decoder |
The structure to keep the state when doing NDN TLV decoding. More... | |
Typedefs | |
typedef struct ndn_decoder | ndn_decoder_t |
The structure to keep the state when doing NDN TLV decoding. More... | |
Functions | |
static void | decoder_init (ndn_decoder_t *decoder, const uint8_t *block_value, uint32_t block_size) |
Init a decoder by setting the wire format buffer and its size. More... | |
static int | decoder_get_var (ndn_decoder_t *decoder, uint32_t *var) |
Get the variable size Type (T) and Length (L). More... | |
static int | decoder_get_type (ndn_decoder_t *decoder, uint32_t *type) |
Get the variable size Type (T). More... | |
static int | decoder_get_length (ndn_decoder_t *decoder, uint32_t *length) |
Get the variable size Length (L). More... | |
static int | decoder_get_raw_buffer_value (ndn_decoder_t *decoder, uint8_t *value, uint32_t size) |
Get the variable size Value (V) to bytes. More... | |
static int | decoder_get_byte_value (ndn_decoder_t *decoder, uint8_t *value) |
Get the fixed size Value (V) to a single byte. More... | |
static int | decoder_get_uint16_value (ndn_decoder_t *decoder, uint16_t *value) |
Get the fixed size Value (V) to a uint16_t. More... | |
static int | decoder_get_uint32_value (ndn_decoder_t *decoder, uint32_t *value) |
Get the fixed size Value (V) to a uint32_t. More... | |
static int | decoder_get_uint64_value (ndn_decoder_t *decoder, uint64_t *value) |
Get the fixed size Value (V) to a uint64_t. More... | |
static int | decoder_get_uint_value (ndn_decoder_t *decoder, uint32_t length, uint64_t *value) |
Get the non-negative int Value (V) to a uint64_t. More... | |
static int | decoder_move_forward (ndn_decoder_t *decoder, uint32_t step) |
Move the decoder's offset forward by. More... | |
static int | decoder_move_backward (ndn_decoder_t *decoder, uint32_t step) |
Move the decoder's offset backward by. More... | |
static uint32_t | decoder_get_offset (const ndn_decoder_t *decoder) |
Get the offset of the decoder. More... | |
typedef struct ndn_decoder ndn_decoder_t |
The structure to keep the state when doing NDN TLV decoding.
|
inlinestatic |
Get the fixed size Value (V) to a single byte.
This function is supposed to be invoked after decoder_get_length().
decoder. | Input/Output. The decoder's offset will be updated. |
value. | Output. The variable to keep the byte value. |
|
inlinestatic |
Get the variable size Length (L).
This function is supposed to be invoked after decoder_get_type().
decoder. | Input/Output. The decoder's offset will be updated. |
length. | Output. The uint32_t to keep the decoded Length (L). |
|
inlinestatic |
Get the offset of the decoder.
decoder. | Input. The decoder's offset will be updated. |
|
inlinestatic |
Get the variable size Value (V) to bytes.
This function is supposed to be invoked after decoder_get_length().
decoder. | Input/Output. The decoder's offset will be updated. |
value. | Output. The variable to keep the value. It must have been initialized with an empty uint8_t array. |
size. | Input. The size should be set to the value obtained from decoder_get_length(). |
|
inlinestatic |
Get the variable size Type (T).
decoder. | Input/Output. The decoder's offset will be updated. |
type. | Output. The uint32_t to keep the decoded Type (T). |
|
inlinestatic |
Get the fixed size Value (V) to a uint16_t.
This function is supposed to be invoked after decoder_get_length().
decoder. | Input/Output. The decoder's offset will be updated. |
value. | Output. The variable to keep the uint16_t value. |
|
inlinestatic |
Get the fixed size Value (V) to a uint32_t.
This function is supposed to be invoked after decoder_get_length().
decoder. | Input/Output. The decoder's offset will be updated. |
value. | Output. The variable to keep the uint32_t value. |
|
inlinestatic |
Get the fixed size Value (V) to a uint64_t.
This function is supposed to be invoked after decoder_get_length().
decoder. | Input/Output. The decoder's offset will be updated. |
value. | Output. The variable to keep the uint64_t value. |
|
inlinestatic |
Get the non-negative int Value (V) to a uint64_t.
This function is supposed to be invoked after decoder_get_length(). TLV-LENGTH of the TLV element MUST be either 1, 2, 4, or 8.
decoder. | Input/Output. The decoder's offset will be updated. |
length. | Input. The Length (L) obtained from decoder_get_length(). |
value. | Output. The variable to keep the non-negative int value. |
|
inlinestatic |
Get the variable size Type (T) and Length (L).
decoder. | Input/Output. The decoder's offset will be updated. |
var. | Output. The uint32_t to keep the decoded Type (T) or Length (L). |
|
inlinestatic |
Init a decoder by setting the wire format buffer and its size.
decoder. | Output. The decoder to be inited. |
block_value. | Input. The wire format buffer. |
block_size. | Input. The size of wire format buffer. |
|
inlinestatic |
Move the decoder's offset backward by.
step. | |
decoder. | Output. The decoder's offset will be updated. |
step. | Input. The step by which the offset will be moved. |
|
inlinestatic |
Move the decoder's offset forward by.
step. | |
decoder. | Output. The decoder's offset will be updated. |
step. | Input. The step by which the offset will be moved. |