Jeff Thompson | 47eecfc | 2013-07-07 22:56:46 -0700 | [diff] [blame] | 1 | /** |
| 2 | * @author: Jeff Thompson |
| 3 | * See COPYING for copyright and distribution information. |
Jeff Thompson | b7f9556 | 2013-07-03 18:36:42 -0700 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef NDN_INTEREST_H |
| 7 | #define NDN_INTEREST_H |
| 8 | |
| 9 | #include "Name.h" |
| 10 | |
| 11 | #ifdef __cplusplus |
| 12 | extern "C" { |
| 13 | #endif |
| 14 | |
| 15 | struct ndn_Interest { |
| 16 | struct ndn_Name name; |
| 17 | int maxSuffixComponents; /**< -1 for none */ |
| 18 | int minSuffixComponents; /**< -1 for none */ |
| 19 | unsigned char *publisherPublicKeyDigest; /**< pointer to pre-allocated buffer. 0 for none */ |
Jeff Thompson | 88ab5dd | 2013-07-07 20:47:46 -0700 | [diff] [blame] | 20 | unsigned int publisherPublicKeyDigestLength; /**< length of publisherPublicKeyDigest. 0 for none */ |
Jeff Thompson | b7f9556 | 2013-07-03 18:36:42 -0700 | [diff] [blame] | 21 | // TODO: implement exclude |
| 22 | int childSelector; /**< -1 for none */ |
| 23 | int answerOriginKind; /**< -1 for none */ |
| 24 | int scope; /**< -1 for none */ |
| 25 | int interestLifetime; /**< milliseconds. -1 for none */ |
| 26 | unsigned char *nonce; /**< pointer to pre-allocated buffer. 0 for none */ |
Jeff Thompson | 88ab5dd | 2013-07-07 20:47:46 -0700 | [diff] [blame] | 27 | unsigned int nonceLength; /**< length of nonce. 0 for none */ |
Jeff Thompson | b7f9556 | 2013-07-03 18:36:42 -0700 | [diff] [blame] | 28 | }; |
| 29 | |
| 30 | static inline void ndn_Interest_init(struct ndn_Interest *self, struct ndn_NameComponent *nameComponents, unsigned int maxNameComponents) |
| 31 | { |
| 32 | ndn_Name_init(&self->name, nameComponents, maxNameComponents); |
| 33 | self->maxSuffixComponents = -1; |
| 34 | self->minSuffixComponents = -1; |
| 35 | self->publisherPublicKeyDigest = 0; |
| 36 | // TODO: implement exclude |
| 37 | self->childSelector = -1; |
| 38 | self->answerOriginKind = -1; |
| 39 | self->scope = -1; |
| 40 | self->interestLifetime = -1; |
| 41 | self->nonce = 0; /**< length of nonce */ |
| 42 | } |
| 43 | |
| 44 | #ifdef __cplusplus |
| 45 | } |
| 46 | #endif |
| 47 | |
| 48 | #endif |
| 49 | |