blob: ceba502c9e5eab9df67a45f88184066a4cbbe2ae [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#include "Interest.hpp"
8
9using namespace std;
10
11namespace ndn {
12
13void Interest::set(struct ndn_Interest &interestStruct)
14{
15 name_.set(interestStruct.name);
16 maxSuffixComponents_ = interestStruct.maxSuffixComponents;
17 minSuffixComponents_ = interestStruct.minSuffixComponents;
18
19 publisherPublicKeyDigest_.clear();
20 if (interestStruct.publisherPublicKeyDigest)
21 publisherPublicKeyDigest_.insert
22 (publisherPublicKeyDigest_.begin(), interestStruct.publisherPublicKeyDigest, interestStruct.publisherPublicKeyDigest + interestStruct.publisherPublicKeyDigestLength);
23 // TODO: implement exclude
24 childSelector_ = interestStruct.childSelector;
25 answerOriginKind_ = interestStruct.answerOriginKind;
26 scope_ = interestStruct.scope;
27 interestLifetime_ = interestStruct.interestLifetime;
28 nonce_.clear();
29 if (interestStruct.nonce)
30 nonce_.insert
31 (nonce_.begin(), interestStruct.nonce, interestStruct.nonce + interestStruct.nonceLength);
32}
33
34}
35