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 
33 typedef enum {
34  ndn_ContentType_BLOB = 0,
35  ndn_ContentType_LINK = 1,
36  ndn_ContentType_KEY = 2,
37  ndn_ContentType_NACK = 3
38 } ndn_ContentType;
39 
44 typedef enum {
45  ndn_SignatureType_DigestSha256Signature = 0,
46  ndn_SignatureType_Sha256WithRsaSignature = 1,
47  ndn_SignatureType_Sha256WithEcdsaSignature = 3,
48  ndn_SignatureType_HmacWithSha256Signature = 4
49 } ndn_SignatureType;
50 
58 struct ndn_Signature {
59  ndn_SignatureType type;
60  struct ndn_Blob signature;
61  struct ndn_KeyLocator keyLocator;
62 };
63 
67 struct ndn_MetaInfo {
68  ndn_MillisecondsSince1970 timestampMilliseconds;
69  ndn_ContentType type;
70  ndn_Milliseconds freshnessPeriod;
72 };
73 
74 struct ndn_Data {
75  struct ndn_Signature signature;
76  struct ndn_Name name;
77  struct ndn_MetaInfo metaInfo;
78  struct ndn_Blob content;
79 };
80 
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif
ndn_MillisecondsSince1970 timestampMilliseconds
milliseconds since 1/1/1970.
Definition: data-types.h:68
ndn_ContentType type
default is ndn_ContentType_DATA.
Definition: data-types.h:69
Definition: data-types.h:74
struct ndn_Blob content
A Blob with a pointer to the content.
Definition: data-types.h:78
ndn_SignatureType type
-1 for none
Definition: data-types.h:59
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:71
Copyright (C) 2015-2016 Regents of the University of California.
Definition: name-types.h:33
An ndn_MetaInfo struct holds the meta info which is signed inside the data packet.
Definition: data-types.h:67
An ndn_Name holds an array of ndn_NameComponent.
Definition: name-types.h:40
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:70
An ndn_Signature struct holds the signature bits and other info representing the signature in a data ...
Definition: data-types.h:58