element-reader-types.h
1 
21 #ifndef NDN_ELEMENT_READER_TYPES_H
22 #define NDN_ELEMENT_READER_TYPES_H
23 
24 #include "../util/dynamic-uint8-array-types.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 struct ndn_ElementListener;
31 typedef void (*ndn_OnReceivedElement)
32  (struct ndn_ElementListener *self, const uint8_t *element, size_t elementLength);
33 
38  ndn_OnReceivedElement onReceivedElement;
39 };
40 
43  size_t offset;
44  int state;
45  size_t headerLength;
47  // 8 bytes is enough to hold the extended bytes in the length encoding where it is an 8-byte number.
48  uint8_t headerBuffer[8];
49  size_t nBytesToRead;
50  unsigned int firstOctet;
51 };
52 
60  struct ndn_ElementListener *elementListener;
61  struct ndn_TlvStructureDecoder tlvStructureDecoder;
64  struct ndn_DynamicUInt8Array* partialData;
65  size_t partialDataLength;
66 };
67 
68 #ifdef __cplusplus
69 }
70 #endif
71 
72 #endif
int gotPartialDataError
boolean.
Definition: element-reader-types.h:63
ndn_OnReceivedElement onReceivedElement
see ndn_ElementListener_initialize
Definition: element-reader-types.h:38
int useHeaderBuffer
boolean
Definition: element-reader-types.h:46
int gotElementEnd
boolean
Definition: element-reader-types.h:42
int usePartialData
boolean
Definition: element-reader-types.h:62
An ndn_ElementListener struct holds a function pointer onReceivedElement.
Definition: element-reader-types.h:37
A struct ndn_DynamicUInt8Array holds a pointer to an allocated array, the length of the allocated arr...
Definition: dynamic-uint8-array-types.h:40
Definition: element-reader-types.h:41
A ndn_ElementReader lets you call ndn_ElementReader_onReceivedData multiple times which uses an ndn_T...
Definition: element-reader-types.h:59