Jeff Thompson | b7f9556 | 2013-07-03 18:36:42 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Author: Jeff Thompson |
| 3 | * |
| 4 | * BSD license, See the LICENSE file for more information. |
| 5 | */ |
| 6 | |
| 7 | #include "Interest.hpp" |
| 8 | |
| 9 | using namespace std; |
| 10 | |
| 11 | namespace ndn { |
| 12 | |
| 13 | void 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 | |