9 #ifndef NDN_ENCODING_NAME_H 10 #define NDN_ENCODING_NAME_H 101 static inline uint32_t
104 uint32_t value_size = 0;
168 const uint8_t* rhs_block_value, uint32_t rhs_block_size);
174 #endif // NDN_ENCODING_NAME_H static uint32_t name_component_probe_block_size(const name_component_t *component)
Probe the size of a Name component TLV block before encoding it from a Name Component structure.
Definition: name-component.h:140
int ndn_name_compare_block(const uint8_t *lhs_block_value, uint32_t lhs_block_size, const uint8_t *rhs_block_value, uint32_t rhs_block_size)
Compare two encoded Names.
Definition: name.c:178
The structure to keep the state when doing NDN TLV decoding.
Definition: decoder.h:21
int ndn_name_init(ndn_name_t *name, const name_component_t *components, uint32_t size)
Init a Name structure.
Definition: name.c:12
int ndn_name_tlv_encode(ndn_encoder_t *encoder, const ndn_name_t *name)
Encode the Name structure into wire format (TLV block).
Definition: name.c:108
struct ndn_name ndn_name_t
The structure to represent the Name.
name_component_t components[NDN_NAME_COMPONENTS_SIZE]
The array of name components contained in this name (not including T and L)
Definition: name.h:28
The structure to represent the Name.
Definition: name.h:24
#define NDN_NAME_COMPONENTS_SIZE
Definition: ndn-constants.h:17
int ndn_name_from_string(ndn_name_t *name, const char *string, uint32_t size)
Init a name block from a string.
Definition: name.c:71
static uint32_t encoder_probe_block_size(uint32_t type, uint32_t payload_size)
Probe the size of a TLV block.
Definition: encoder.h:82
static uint32_t ndn_name_probe_block_size(const ndn_name_t *name)
Probe the size of a Name TLV block before encoding it from a Name structure.
Definition: name.h:102
uint8_t value[NDN_NAME_COMPONENT_BUFFER_SIZE]
The value which name component holds.
Definition: name-component.h:31
The structure to represent the Name Component.
Definition: name-component.h:23
static void ndn_name_print(ndn_name_t *name)
Print a name.
Definition: name.h:40
int ndn_name_compare_sub_names(const ndn_name_t *lhs, int lhs_b, int lhs_e, const ndn_name_t *rhs, int rhs_b, int rhs_e)
Compare sub-names of two names.
Definition: name.c:145
int ndn_name_is_prefix_of(const ndn_name_t *lhs, const ndn_name_t *rhs)
Compare two Name based on the canonical order, to see whether a name is the prefix of another.
Definition: name.c:159
int ndn_name_compare(const ndn_name_t *lhs, const ndn_name_t *rhs)
Compare two Name.
Definition: name.c:131
The structure to keep the state when doing NDN TLV encoding.
Definition: encoder.h:31
int ndn_name_append_component(ndn_name_t *name, const name_component_t *component)
Appends a component to the end of a name.
Definition: name.c:59
uint32_t size
The size of component value buffer.
Definition: name-component.h:35
int ndn_name_tlv_decode(ndn_decoder_t *decoder, ndn_name_t *name)
Decode the Name from wire format (TLV block).
Definition: name.c:24
uint32_t components_size
The number of name components.
Definition: name.h:32
int ndn_name_from_block(ndn_name_t *name, const uint8_t *block_value, uint32_t block_size)
Decode an Name TLV block into an Name.
Definition: name.c:51