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 level;
45  int state;
46  size_t headerLength;
48  // 10 bytes is enough to hold an encoded header with a type and a 64 bit value.
49  uint8_t headerBuffer[10];
50  int nBytesToRead;
51 };
52 
55  size_t offset;
56  int state;
57  size_t headerLength;
59  // 8 bytes is enough to hold the extended bytes in the length encoding where it is an 8-byte number.
60  uint8_t headerBuffer[8];
61  int nBytesToRead;
62  unsigned int firstOctet;
63 };
64 
72  struct ndn_ElementListener *elementListener;
73  struct ndn_BinaryXmlStructureDecoder binaryXmlStructureDecoder;
74  struct ndn_TlvStructureDecoder tlvStructureDecoder;
77  struct ndn_DynamicUInt8Array* partialData;
78  size_t partialDataLength;
79  int useTlv;
80 };
81 
82 #ifdef __cplusplus
83 }
84 #endif
85 
86 #endif
int useHeaderBuffer
boolean
Definition: element-reader-types.h:47
int gotPartialDataError
boolean.
Definition: element-reader-types.h:76
ndn_OnReceivedElement onReceivedElement
see ndn_ElementListener_initialize
Definition: element-reader-types.h:38
int useHeaderBuffer
boolean
Definition: element-reader-types.h:58
int gotElementEnd
boolean
Definition: element-reader-types.h:54
int usePartialData
boolean
Definition: element-reader-types.h:75
int gotElementEnd
boolean
Definition: element-reader-types.h:42
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:53
Definition: element-reader-types.h:41
int useTlv
boolean
Definition: element-reader-types.h:79
A ndn_ElementReader lets you call ndn_ElementReader_onReceivedData multiple times which uses an ndn_B...
Definition: element-reader-types.h:71