Go to the source code of this file.
◆ ndn_metainfo_t
The structure to represent the Metainfo structure.
◆ ndn_metainfo_from_other()
Init a Metainfo structure.
This function will do memory copy.
- Parameters
-
meta. | Output. The Metainfo structure to be inited. |
other. | Output. The Metainfo structure to be copied from. |
◆ 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_init()
Init a Metainfo structure.
- Parameters
-
meta. | Output. The Metainfo structure to be inited. |
◆ ndn_metainfo_probe_block_size()
static uint32_t ndn_metainfo_probe_block_size |
( |
const ndn_metainfo_t * |
meta | ) |
|
|
inlinestatic |
Probe the size of a Metainfo TLV block before encoding it from a Metainfo structure.
This function is used to check whether the output buffer size is enough or not.
- Parameters
-
meta. | Input. The Metainfo structure to probe. |
- Returns
- the length of the Metainfo TLV block.
◆ ndn_metainfo_set_content_type()
static void ndn_metainfo_set_content_type |
( |
ndn_metainfo_t * |
meta, |
|
|
uint8_t |
content_type |
|
) |
| |
|
inlinestatic |
Set ContentType of the Metainfo.
- Parameters
-
meta. | Output. The Metainfo whose ContentType will be set. |
content_type. | Input. ContentType value following NDN Packet Format Specification 0.3. |
◆ ndn_metainfo_set_final_block_id()
Set FinalBlockId of the Metainfo.
- Parameters
-
meta. | Output. The Metainfo whose FinalBlockId will be set. |
final_block_id. | Input. The last component of Name. |
◆ ndn_metainfo_set_freshness_period()
static void ndn_metainfo_set_freshness_period |
( |
ndn_metainfo_t * |
meta, |
|
|
uint64_t |
freshness_period |
|
) |
| |
|
inlinestatic |
Set FreshnessPeriod of the Metainfo.
- Parameters
-
meta. | Output. The Metainfo whose FreshnessPeriod will be set. |
freshness_period. | Input. FreshnessPeriod value. |
◆ ndn_metainfo_tlv_decode()
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()
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.