Jeff Thompson | 25b4e61 | 2013-10-10 16:03:24 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
Jeff Thompson | 47eecfc | 2013-07-07 22:56:46 -0700 | [diff] [blame] | 2 | /** |
Jeff Thompson | 7687dc0 | 2013-09-13 11:54:07 -0700 | [diff] [blame] | 3 | * Copyright (C) 2013 Regents of the University of California. |
| 4 | * @author: Jeff Thompson <jefft0@remap.ucla.edu> |
Jeff Thompson | 47eecfc | 2013-07-07 22:56:46 -0700 | [diff] [blame] | 5 | * See COPYING for copyright and distribution information. |
Jeff Thompson | b7f9556 | 2013-07-03 18:36:42 -0700 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef NDN_INTEREST_HPP |
Jeff Thompson | 2d27e2f | 2013-08-09 12:55:00 -0700 | [diff] [blame] | 9 | #define NDN_INTEREST_HPP |
Jeff Thompson | b7f9556 | 2013-07-03 18:36:42 -0700 | [diff] [blame] | 10 | |
Jeff Thompson | 5341219 | 2013-08-06 13:35:50 -0700 | [diff] [blame] | 11 | #include "name.hpp" |
| 12 | #include "publisher-public-key-digest.hpp" |
Jeff Thompson | 25b4e61 | 2013-10-10 16:03:24 -0700 | [diff] [blame] | 13 | #include "c/interest-types.h" |
| 14 | #include "encoding/wire-format.hpp" |
| 15 | |
| 16 | struct ndn_ExcludeEntry; |
| 17 | struct ndn_Exclude; |
| 18 | struct ndn_Interest; |
Jeff Thompson | b7f9556 | 2013-07-03 18:36:42 -0700 | [diff] [blame] | 19 | |
| 20 | namespace ndn { |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 21 | |
Jeff Thompson | 8238d00 | 2013-07-10 11:56:49 -0700 | [diff] [blame] | 22 | /** |
| 23 | * An ExcludeEntry holds an ndn_ExcludeType, and if it is a COMPONENT, it holds the component value. |
| 24 | */ |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 25 | class ExcludeEntry { |
| 26 | public: |
| 27 | /** |
| 28 | * Create an ExcludeEntry of type ndn_Exclude_ANY |
| 29 | */ |
| 30 | ExcludeEntry() |
| 31 | : type_(ndn_Exclude_ANY) |
| 32 | { |
| 33 | } |
| 34 | |
| 35 | /** |
Jeff Thompson | 832d297 | 2013-10-31 11:24:55 -0700 | [diff] [blame^] | 36 | * Create an ExcludeEntry of type ndn_Exclude_COMPONENT. |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 37 | */ |
Jeff Thompson | 97223af | 2013-09-24 17:01:27 -0700 | [diff] [blame] | 38 | ExcludeEntry(uint8_t *component, size_t componentLen) |
Jeff Thompson | 38d0e08 | 2013-08-12 18:07:44 -0700 | [diff] [blame] | 39 | : type_(ndn_Exclude_COMPONENT), component_(component, componentLen) |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 40 | { |
| 41 | } |
| 42 | |
| 43 | /** |
Jeff Thompson | 832d297 | 2013-10-31 11:24:55 -0700 | [diff] [blame^] | 44 | * Create an ExcludeEntry of type ndn_Exclude_COMPONENT. |
| 45 | */ |
| 46 | ExcludeEntry(const Blob& component) |
| 47 | : type_(ndn_Exclude_COMPONENT), component_(component) |
| 48 | { |
| 49 | } |
| 50 | |
| 51 | /** |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 52 | * Set the type in the excludeEntryStruct and to point to this component, without copying any memory. |
| 53 | * WARNING: The resulting pointer in excludeEntryStruct is invalid after a further use of this object which could reallocate memory. |
Jeff Thompson | 8238d00 | 2013-07-10 11:56:49 -0700 | [diff] [blame] | 54 | * @param excludeEntryStruct the C ndn_NameComponent struct to receive the pointer |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 55 | */ |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 56 | void |
Jeff Thompson | 25b4e61 | 2013-10-10 16:03:24 -0700 | [diff] [blame] | 57 | get(struct ndn_ExcludeEntry& excludeEntryStruct) const; |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 58 | |
| 59 | ndn_ExcludeType getType() const { return type_; } |
| 60 | |
Jeff Thompson | 1656e6a | 2013-08-29 18:01:48 -0700 | [diff] [blame] | 61 | const Name::Component& getComponent() const { return component_; } |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 62 | |
| 63 | private: |
| 64 | ndn_ExcludeType type_; |
Jeff Thompson | 38d0e08 | 2013-08-12 18:07:44 -0700 | [diff] [blame] | 65 | Name::Component component_; /**< only used if type_ is ndn_Exclude_COMPONENT */ |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 66 | }; |
| 67 | |
Jeff Thompson | 8238d00 | 2013-07-10 11:56:49 -0700 | [diff] [blame] | 68 | /** |
| 69 | * An Exclude holds a vector of ExcludeEntry. |
| 70 | */ |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 71 | class Exclude { |
| 72 | public: |
| 73 | /** |
| 74 | * Create a new Exclude with no entries. |
| 75 | */ |
| 76 | Exclude() { |
| 77 | } |
| 78 | |
Jeff Thompson | 97223af | 2013-09-24 17:01:27 -0700 | [diff] [blame] | 79 | size_t |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 80 | getEntryCount() const { |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 81 | return entries_.size(); |
| 82 | } |
| 83 | |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 84 | const ExcludeEntry& |
Jeff Thompson | 97223af | 2013-09-24 17:01:27 -0700 | [diff] [blame] | 85 | getEntry(size_t i) const { return entries_[i]; } |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 86 | |
| 87 | /** |
Jeff Thompson | 8238d00 | 2013-07-10 11:56:49 -0700 | [diff] [blame] | 88 | * Set the excludeStruct to point to the entries in this Exclude, without copying any memory. |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 89 | * WARNING: The resulting pointers in excludeStruct are invalid after a further use of this object which could reallocate memory. |
Jeff Thompson | 8238d00 | 2013-07-10 11:56:49 -0700 | [diff] [blame] | 90 | * @param excludeStruct a C ndn_Exclude struct where the entries array is already allocated |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 91 | */ |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 92 | void |
| 93 | get(struct ndn_Exclude& excludeStruct) const; |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 94 | |
| 95 | /** |
Jeff Thompson | 8238d00 | 2013-07-10 11:56:49 -0700 | [diff] [blame] | 96 | * Clear this Exclude, and set the entries by copying from the ndn_Exclude struct. |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 97 | * @param excludeStruct a C ndn_Exclude struct |
| 98 | */ |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 99 | void |
| 100 | set(const struct ndn_Exclude& excludeStruct); |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 101 | |
| 102 | /** |
Jeff Thompson | 832d297 | 2013-10-31 11:24:55 -0700 | [diff] [blame^] | 103 | * Append a new entry of type ndn_Exclude_ANY. |
| 104 | * @return This Exclude so that you can chain calls to append. |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 105 | */ |
Jeff Thompson | 832d297 | 2013-10-31 11:24:55 -0700 | [diff] [blame^] | 106 | Exclude& |
| 107 | appendAny() |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 108 | { |
| 109 | entries_.push_back(ExcludeEntry()); |
Jeff Thompson | 832d297 | 2013-10-31 11:24:55 -0700 | [diff] [blame^] | 110 | return *this; |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 111 | } |
| 112 | |
| 113 | /** |
Jeff Thompson | 832d297 | 2013-10-31 11:24:55 -0700 | [diff] [blame^] | 114 | * Append a new entry of type ndn_Exclude_COMPONENT, copying from component of length compnentLength. |
| 115 | * @param component A pointer to the component byte array. |
| 116 | * @param componentLength The length of component. |
| 117 | * @return This Exclude so that you can chain calls to append. |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 118 | */ |
Jeff Thompson | 832d297 | 2013-10-31 11:24:55 -0700 | [diff] [blame^] | 119 | Exclude& |
| 120 | appendComponent(uint8_t *component, size_t componentLength) |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 121 | { |
Jeff Thompson | 832d297 | 2013-10-31 11:24:55 -0700 | [diff] [blame^] | 122 | entries_.push_back(ExcludeEntry(component, componentLength)); |
| 123 | return *this; |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 124 | } |
Jeff Thompson | 832d297 | 2013-10-31 11:24:55 -0700 | [diff] [blame^] | 125 | |
| 126 | /** |
| 127 | * Append a new entry of type ndn_Exclude_COMPONENT, copying from component of length compnentLength. |
| 128 | * @param component A blob with a pointer to an immutable array. The pointer is copied. |
| 129 | * @return This Exclude so that you can chain calls to append. |
| 130 | */ |
| 131 | Exclude& |
| 132 | appendComponent(const Blob &component) |
| 133 | { |
| 134 | entries_.push_back(ExcludeEntry(component)); |
| 135 | return *this; |
| 136 | } |
| 137 | |
| 138 | /** |
| 139 | * @deprecated Use appendAny. |
| 140 | */ |
| 141 | Exclude& |
| 142 | addAny() { return appendAny(); } |
| 143 | |
| 144 | /** |
| 145 | * @deprecated Use appendComponent. |
| 146 | */ |
| 147 | Exclude& |
| 148 | addComponent(uint8_t *component, size_t componentLength) { return appendComponent(component, componentLength); } |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 149 | |
| 150 | /** |
| 151 | * Clear all the entries. |
| 152 | */ |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 153 | void |
| 154 | clear() { |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 155 | entries_.clear(); |
| 156 | } |
| 157 | |
Jeff Thompson | 37527d6 | 2013-08-21 11:15:54 -0700 | [diff] [blame] | 158 | /** |
| 159 | * Encode this Exclude with elements separated by "," and ndn_Exclude_ANY shown as "*". |
| 160 | * @return the URI string |
| 161 | */ |
| 162 | std::string toUri() const; |
| 163 | |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 164 | private: |
Jeff Thompson | 2d27e2f | 2013-08-09 12:55:00 -0700 | [diff] [blame] | 165 | std::vector<ExcludeEntry> entries_; |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 166 | }; |
Jeff Thompson | b7f9556 | 2013-07-03 18:36:42 -0700 | [diff] [blame] | 167 | |
Jeff Thompson | 8238d00 | 2013-07-10 11:56:49 -0700 | [diff] [blame] | 168 | /** |
| 169 | * An Interest holds a Name and other fields for an interest. |
| 170 | */ |
Jeff Thompson | b7f9556 | 2013-07-03 18:36:42 -0700 | [diff] [blame] | 171 | class Interest { |
| 172 | public: |
Jeff Thompson | 1656e6a | 2013-08-29 18:01:48 -0700 | [diff] [blame] | 173 | Interest(const Name& name, int minSuffixComponents, int maxSuffixComponents, |
| 174 | const PublisherPublicKeyDigest& publisherPublicKeyDigest, const Exclude& exclude, int childSelector, int answerOriginKind, |
Jeff Thompson | 9a8e82f | 2013-10-17 14:13:43 -0700 | [diff] [blame] | 175 | int scope, Milliseconds interestLifetimeMilliseconds, const std::vector<uint8_t>& nonce) |
Jeff Thompson | f59a87a | 2013-07-31 16:55:41 -0700 | [diff] [blame] | 176 | : name_(name), minSuffixComponents_(minSuffixComponents), maxSuffixComponents_(maxSuffixComponents), |
| 177 | publisherPublicKeyDigest_(publisherPublicKeyDigest), exclude_(exclude), childSelector_(childSelector), |
| 178 | answerOriginKind_(answerOriginKind), scope_(scope), interestLifetimeMilliseconds_(interestLifetimeMilliseconds), |
| 179 | nonce_(nonce) |
| 180 | { |
| 181 | } |
Jeff Thompson | 3f76e9e | 2013-08-21 13:14:58 -0700 | [diff] [blame] | 182 | |
Jeff Thompson | 1656e6a | 2013-08-29 18:01:48 -0700 | [diff] [blame] | 183 | Interest(const Name& name, int minSuffixComponents, int maxSuffixComponents, |
| 184 | const PublisherPublicKeyDigest& publisherPublicKeyDigest, const Exclude& exclude, int childSelector, int answerOriginKind, |
Jeff Thompson | 9a8e82f | 2013-10-17 14:13:43 -0700 | [diff] [blame] | 185 | int scope, Milliseconds interestLifetimeMilliseconds) |
Jeff Thompson | 3f76e9e | 2013-08-21 13:14:58 -0700 | [diff] [blame] | 186 | : name_(name), minSuffixComponents_(minSuffixComponents), maxSuffixComponents_(maxSuffixComponents), |
| 187 | publisherPublicKeyDigest_(publisherPublicKeyDigest), exclude_(exclude), childSelector_(childSelector), |
| 188 | answerOriginKind_(answerOriginKind), scope_(scope), interestLifetimeMilliseconds_(interestLifetimeMilliseconds) |
| 189 | { |
| 190 | } |
| 191 | |
Jeff Thompson | 9a8e82f | 2013-10-17 14:13:43 -0700 | [diff] [blame] | 192 | Interest(const Name& name, Milliseconds interestLifetimeMilliseconds) |
Jeff Thompson | f62382a | 2013-08-21 16:33:39 -0700 | [diff] [blame] | 193 | : name_(name) |
| 194 | { |
| 195 | construct(); |
| 196 | interestLifetimeMilliseconds_ = interestLifetimeMilliseconds; |
| 197 | } |
| 198 | |
Jeff Thompson | 1656e6a | 2013-08-29 18:01:48 -0700 | [diff] [blame] | 199 | Interest(const Name& name) |
Jeff Thompson | 3f76e9e | 2013-08-21 13:14:58 -0700 | [diff] [blame] | 200 | : name_(name) |
| 201 | { |
Jeff Thompson | 3f76e9e | 2013-08-21 13:14:58 -0700 | [diff] [blame] | 202 | construct(); |
| 203 | } |
| 204 | |
| 205 | Interest() |
| 206 | { |
| 207 | construct(); |
| 208 | } |
Jeff Thompson | f59a87a | 2013-07-31 16:55:41 -0700 | [diff] [blame] | 209 | |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 210 | Blob |
| 211 | wireEncode(WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) const |
Jeff Thompson | b7f9556 | 2013-07-03 18:36:42 -0700 | [diff] [blame] | 212 | { |
Jeff Thompson | b0979fd | 2013-07-30 15:48:21 -0700 | [diff] [blame] | 213 | return wireFormat.encodeInterest(*this); |
Jeff Thompson | b7f9556 | 2013-07-03 18:36:42 -0700 | [diff] [blame] | 214 | } |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 215 | |
| 216 | void |
Jeff Thompson | 97223af | 2013-09-24 17:01:27 -0700 | [diff] [blame] | 217 | wireDecode(const uint8_t *input, size_t inputLength, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) |
Jeff Thompson | b7f9556 | 2013-07-03 18:36:42 -0700 | [diff] [blame] | 218 | { |
| 219 | wireFormat.decodeInterest(*this, input, inputLength); |
| 220 | } |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 221 | |
| 222 | void |
Jeff Thompson | 10ad12a | 2013-09-24 16:19:11 -0700 | [diff] [blame] | 223 | wireDecode(const std::vector<uint8_t>& input, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) |
Jeff Thompson | b7f9556 | 2013-07-03 18:36:42 -0700 | [diff] [blame] | 224 | { |
Jeff Thompson | 67e9e0a | 2013-08-02 19:16:19 -0700 | [diff] [blame] | 225 | wireDecode(&input[0], input.size(), wireFormat); |
Jeff Thompson | b7f9556 | 2013-07-03 18:36:42 -0700 | [diff] [blame] | 226 | } |
Jeff Thompson | d9e278c | 2013-07-08 15:20:13 -0700 | [diff] [blame] | 227 | |
| 228 | /** |
| 229 | * Set the interestStruct to point to the components in this interest, without copying any memory. |
| 230 | * WARNING: The resulting pointers in interestStruct are invalid after a further use of this object which could reallocate memory. |
| 231 | * @param interestStruct a C ndn_Interest struct where the name components array is already allocated. |
| 232 | */ |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 233 | void |
| 234 | get(struct ndn_Interest& interestStruct) const; |
Jeff Thompson | b7f9556 | 2013-07-03 18:36:42 -0700 | [diff] [blame] | 235 | |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 236 | Name& |
| 237 | getName() { return name_; } |
Jeff Thompson | b7f9556 | 2013-07-03 18:36:42 -0700 | [diff] [blame] | 238 | |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 239 | const Name& |
| 240 | getName() const { return name_; } |
Jeff Thompson | d345a5b | 2013-07-08 16:18:23 -0700 | [diff] [blame] | 241 | |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 242 | int |
| 243 | getMinSuffixComponents() const { return minSuffixComponents_; } |
Jeff Thompson | 0a68172 | 2013-07-08 16:21:54 -0700 | [diff] [blame] | 244 | |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 245 | int |
| 246 | getMaxSuffixComponents() const { return maxSuffixComponents_; } |
Jeff Thompson | 0a68172 | 2013-07-08 16:21:54 -0700 | [diff] [blame] | 247 | |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 248 | PublisherPublicKeyDigest& |
| 249 | getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; } |
| 250 | |
| 251 | const PublisherPublicKeyDigest& |
| 252 | getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; } |
Jeff Thompson | 0a68172 | 2013-07-08 16:21:54 -0700 | [diff] [blame] | 253 | |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 254 | Exclude& |
| 255 | getExclude() { return exclude_; } |
| 256 | |
| 257 | const Exclude& |
| 258 | getExclude() const { return exclude_; } |
| 259 | |
| 260 | int |
| 261 | getChildSelector() const { return childSelector_; } |
Jeff Thompson | 0a68172 | 2013-07-08 16:21:54 -0700 | [diff] [blame] | 262 | |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 263 | int |
| 264 | getAnswerOriginKind() const { return answerOriginKind_; } |
Jeff Thompson | d345a5b | 2013-07-08 16:18:23 -0700 | [diff] [blame] | 265 | |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 266 | int |
| 267 | getScope() const { return scope_; } |
Jeff Thompson | 0a68172 | 2013-07-08 16:21:54 -0700 | [diff] [blame] | 268 | |
Jeff Thompson | 9a8e82f | 2013-10-17 14:13:43 -0700 | [diff] [blame] | 269 | Milliseconds |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 270 | getInterestLifetimeMilliseconds() const { return interestLifetimeMilliseconds_; } |
| 271 | |
| 272 | const Blob& |
| 273 | getNonce() const { return nonce_; } |
Jeff Thompson | 2255290 | 2013-07-07 21:26:20 -0700 | [diff] [blame] | 274 | |
Jeff Thompson | b7f9556 | 2013-07-03 18:36:42 -0700 | [diff] [blame] | 275 | /** |
| 276 | * Clear this interest, and set the values by copying from the interest struct. |
| 277 | * @param interestStruct a C ndn_Interest struct |
| 278 | */ |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 279 | void |
| 280 | set(const struct ndn_Interest& interestStruct); |
Jeff Thompson | eb316a8 | 2013-07-09 15:11:17 -0700 | [diff] [blame] | 281 | |
Jeff Thompson | 4b70d3d | 2013-10-21 17:34:34 -0700 | [diff] [blame] | 282 | void |
| 283 | setName(const Name& name) { name_ = name; } |
| 284 | |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 285 | void |
| 286 | setMinSuffixComponents(int value) { minSuffixComponents_ = value; } |
Jeff Thompson | eb316a8 | 2013-07-09 15:11:17 -0700 | [diff] [blame] | 287 | |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 288 | void |
| 289 | setMaxSuffixComponents(int value) { maxSuffixComponents_ = value; } |
Jeff Thompson | eb316a8 | 2013-07-09 15:11:17 -0700 | [diff] [blame] | 290 | |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 291 | void |
| 292 | setChildSelector(int value) { childSelector_ = value; } |
Jeff Thompson | eb316a8 | 2013-07-09 15:11:17 -0700 | [diff] [blame] | 293 | |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 294 | void |
| 295 | setAnswerOriginKind(int value) { answerOriginKind_ = value; } |
Jeff Thompson | eb316a8 | 2013-07-09 15:11:17 -0700 | [diff] [blame] | 296 | |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 297 | void |
| 298 | setScope(int value) { scope_ = value; } |
Jeff Thompson | eb316a8 | 2013-07-09 15:11:17 -0700 | [diff] [blame] | 299 | |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 300 | void |
Jeff Thompson | 9a8e82f | 2013-10-17 14:13:43 -0700 | [diff] [blame] | 301 | setInterestLifetimeMilliseconds(Milliseconds value) { interestLifetimeMilliseconds_ = value; } |
Jeff Thompson | eb316a8 | 2013-07-09 15:11:17 -0700 | [diff] [blame] | 302 | |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 303 | void |
Jeff Thompson | 10ad12a | 2013-09-24 16:19:11 -0700 | [diff] [blame] | 304 | setNonce(const std::vector<uint8_t>& value) { nonce_ = value; } |
Jeff Thompson | eb316a8 | 2013-07-09 15:11:17 -0700 | [diff] [blame] | 305 | |
Jeff Thompson | b7f9556 | 2013-07-03 18:36:42 -0700 | [diff] [blame] | 306 | private: |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 307 | void |
| 308 | construct() |
Jeff Thompson | c0486c1 | 2013-07-16 14:36:16 -0700 | [diff] [blame] | 309 | { |
Jeff Thompson | 2d27e2f | 2013-08-09 12:55:00 -0700 | [diff] [blame] | 310 | minSuffixComponents_ = -1; |
| 311 | maxSuffixComponents_ = -1; |
| 312 | childSelector_ = -1; |
| 313 | answerOriginKind_ = -1; |
| 314 | scope_ = -1; |
| 315 | interestLifetimeMilliseconds_ = -1.0; |
Jeff Thompson | c0486c1 | 2013-07-16 14:36:16 -0700 | [diff] [blame] | 316 | } |
Jeff Thompson | b7f9556 | 2013-07-03 18:36:42 -0700 | [diff] [blame] | 317 | |
| 318 | Name name_; |
Jeff Thompson | 2d27e2f | 2013-08-09 12:55:00 -0700 | [diff] [blame] | 319 | int minSuffixComponents_; |
| 320 | int maxSuffixComponents_; |
| 321 | PublisherPublicKeyDigest publisherPublicKeyDigest_; |
Jeff Thompson | fe55686 | 2013-07-09 13:52:55 -0700 | [diff] [blame] | 322 | Exclude exclude_; |
Jeff Thompson | 2d27e2f | 2013-08-09 12:55:00 -0700 | [diff] [blame] | 323 | int childSelector_; |
| 324 | int answerOriginKind_; |
| 325 | int scope_; |
Jeff Thompson | 9a8e82f | 2013-10-17 14:13:43 -0700 | [diff] [blame] | 326 | Milliseconds interestLifetimeMilliseconds_; |
Jeff Thompson | 412226d | 2013-09-12 15:55:46 -0700 | [diff] [blame] | 327 | Blob nonce_; |
Jeff Thompson | b7f9556 | 2013-07-03 18:36:42 -0700 | [diff] [blame] | 328 | }; |
| 329 | |
| 330 | } |
| 331 | |
| 332 | #endif |