data-types.h
1 
21 #ifndef NDN_DATA_TYPES_H
22 #define NDN_DATA_TYPES_H
23 
24 #include "key-types.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
38 typedef enum {
39  ndn_ContentType_BLOB = 0,
40  ndn_ContentType_LINK = 1,
41  ndn_ContentType_KEY = 2,
42  ndn_ContentType_NACK = 3,
43  ndn_ContentType_OTHER_CODE = 0x7fff
44 } ndn_ContentType;
45 
50 typedef enum {
51  ndn_SignatureType_DigestSha256Signature = 0,
52  ndn_SignatureType_Sha256WithRsaSignature = 1,
53  ndn_SignatureType_Sha256WithEcdsaSignature = 3,
54  ndn_SignatureType_HmacWithSha256Signature = 4,
55  ndn_SignatureType_Generic = 0x7fff
56 } ndn_SignatureType;
57 
65 struct ndn_Signature {
66  ndn_SignatureType type;
67  struct ndn_Blob signature;
72 };
73 
77 struct ndn_MetaInfo {
78  ndn_MillisecondsSince1970 timestampMilliseconds;
79  ndn_ContentType type;
80  int otherTypeCode;
81  ndn_Milliseconds freshnessPeriod;
83 };
84 
85 struct ndn_Data {
86  struct ndn_Signature signature;
87  struct ndn_Name name;
88  struct ndn_MetaInfo metaInfo;
89  struct ndn_Blob content;
90 };
91 
92 #ifdef __cplusplus
93 }
94 #endif
95 
96 #endif
ndn_MillisecondsSince1970 timestampMilliseconds
milliseconds since 1/1/1970.
Definition: data-types.h:78
int genericTypeCode
used with Generic.
Definition: data-types.h:69
ndn_ContentType type
default is ndn_ContentType_BLOB.
Definition: data-types.h:79
Definition: data-types.h:85
struct ndn_Blob content
A Blob with a pointer to the content.
Definition: data-types.h:89
ndn_SignatureType type
-1 for unspecified
Definition: data-types.h:66
An ndn_KeyLocator holds the type of key locator and related data.
Definition: key-types.h:38
struct ndn_NameComponent finalBlockId
has a pointer to a pre-allocated buffer.
Definition: data-types.h:82
struct ndn_KeyLocator keyLocator
used with Sha256WithRsaSignature, Sha256WithEcdsaSignature, HmacWithSha256Signature ...
Definition: data-types.h:70
An ndn_NameComponent holds a pointer to the component value.
Definition: name-types.h:41
An ndn_MetaInfo struct holds the meta info which is signed inside the data packet.
Definition: data-types.h:77
An ndn_Name holds an array of ndn_NameComponent.
Definition: name-types.h:49
Copyright (C) 2015-2016 Regents of the University of California.
Definition: blob-types.h:33
ndn_Milliseconds freshnessPeriod
-1 for none
Definition: data-types.h:81
An ndn_Signature struct holds the signature bits and other info representing the signature in a data ...
Definition: data-types.h:65
struct ndn_Blob signatureInfoEncoding
used with Generic
Definition: data-types.h:68