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