ndn-lite
wrapper-api.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Xinyu Ma
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v3.0. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 #ifndef NDN_ENCODING_WRAPPER_API_H
9 #define NDN_ENCODING_WRAPPER_API_H
10 
11 #include <stdint.h>
12 #include <stdbool.h>
13 #include <stddef.h>
14 #include "name.h"
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
40 
51 
62 
72 
82 
92 
104 
114 
125 
134 
144 
153 
164 
174 
183 };
184 
217 int
218 tlv_make_data(uint8_t* buf, size_t buflen, size_t* result_size, int argc, ...);
219 
250 int
251 tlv_parse_data(uint8_t* buf, size_t buflen, int argc, ...);
252 
267 
278 
289 
299 
309 
319 
329 
340 
349 
359 
368 
379 
388 };
389 
420 int
421 tlv_make_interest(uint8_t* buf, size_t buflen, size_t* result_size, int argc, ...);
422 
447 int
448 tlv_parse_interest(uint8_t* buf, size_t buflen, int argc, ...);
449 
455 void
456 tlv_encode_segno(name_component_t* comp, uint64_t val);
457 
463 uint64_t
465 
468 #ifdef __cplusplus
469 }
470 #endif
471 
472 #endif // NDN_ENCODING_WRAPPER_API_H
int tlv_make_interest(uint8_t *buf, size_t buflen, size_t *result_size, int argc,...)
All-in-one function to generate an Interest packet.
Definition: wrapper-api.c:494
Interest parameters.
Definition: wrapper-api.h:339
uint64_t tlv_decode_segno(name_component_t *comp)
Decode a name component into a segment number.
Definition: wrapper-api.c:43
Content type.
Definition: wrapper-api.h:71
A pointer to an encoded final block id.
Definition: wrapper-api.h:103
A pointer to an encoded TLV name.
Definition: wrapper-api.h:50
Signature type.
Definition: wrapper-api.h:143
CanBePrefix.
Definition: wrapper-api.h:298
A pointer to a final block id.
Definition: wrapper-api.h:91
Verify the Data after decoding.
Definition: wrapper-api.h:182
Interest lifetime in milliseconds.
Definition: wrapper-api.h:318
Segment number.
Definition: wrapper-api.h:288
A pointer to a final block id, in form of segment number.
Definition: wrapper-api.h:113
Payload.
Definition: wrapper-api.h:124
Verify the Interest after decoding.
Definition: wrapper-api.h:387
A pointer to the name of identity.
Definition: wrapper-api.h:367
Segment number.
Definition: wrapper-api.h:61
A pointer to the key.
Definition: wrapper-api.h:163
A pointer to an encoded TLV name.
Definition: wrapper-api.h:277
The size of Interest parameters.
Definition: wrapper-api.h:348
A pointer to the name of identity.
Definition: wrapper-api.h:152
The size of content.
Definition: wrapper-api.h:133
The signature timestamp.
Definition: wrapper-api.h:173
int tlv_parse_data(uint8_t *buf, size_t buflen, int argc,...)
All-in-one function to parse a Data packet.
Definition: wrapper-api.c:230
MustBeFresh.
Definition: wrapper-api.h:308
A pointer to a name.
Definition: wrapper-api.h:39
TLV_DATAARG_TYPE
The type of variant args of tlv_make_data and tlv_parse_data.
Definition: wrapper-api.h:29
int tlv_parse_interest(uint8_t *buf, size_t buflen, int argc,...)
All-in-one function to parse an Interest packet.
Definition: wrapper-api.c:645
The structure to represent the Name Component.
Definition: name-component.h:23
TLV_INTARG_TYPE
The type of variant args of tlv_make_interest.
Definition: wrapper-api.h:256
Signature type.
Definition: wrapper-api.h:358
Interest HopLimit.
Definition: wrapper-api.h:328
void tlv_encode_segno(name_component_t *comp, uint64_t val)
Encode a name component from a segment number.
Definition: wrapper-api.c:21
Freshness period.
Definition: wrapper-api.h:81
A pointer to a name.
Definition: wrapper-api.h:266
A pointer to the key.
Definition: wrapper-api.h:378
int tlv_make_data(uint8_t *buf, size_t buflen, size_t *result_size, int argc,...)
All-in-one function to generate a Data packet.
Definition: wrapper-api.c:60