dhcp6_client.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. // Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // Permission to use, copy, modify, and/or distribute this software for any
  4. // purpose with or without fee is hereby granted, provided that the above
  5. // copyright notice and this permission notice appear in all copies.
  6. //
  7. // THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  8. // REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  9. // AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  10. // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  11. // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  12. // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  13. // PERFORMANCE OF THIS SOFTWARE.
  14. #ifndef DHCP6_CLIENT_H
  15. #define DHCP6_CLIENT_H
  16. #include <asiolink/io_address.h>
  17. #include <dhcp/duid.h>
  18. #include <dhcp/option.h>
  19. #include <dhcp/option6_client_fqdn.h>
  20. #include <dhcp6/tests/dhcp6_test_utils.h>
  21. #include <boost/noncopyable.hpp>
  22. #include <boost/shared_ptr.hpp>
  23. #include <set>
  24. #include <vector>
  25. namespace isc {
  26. namespace dhcp {
  27. namespace test {
  28. /// @brief DHCPv6 client used for unit testing.
  29. ///
  30. /// This class implements a DHCPv6 "client" which interoperates with the
  31. /// @c NakedDhcpv6Srv class. It calls @c NakedDhcpv6Srv::fakeRecive to
  32. /// deliver client messages to the server for processing. The server places
  33. /// the response in the @c NakedDhcpv6Srv::fake_sent_ container. The client
  34. /// pops messages from this container which simulates reception of the
  35. /// response from the server.
  36. ///
  37. /// The client maintains the leases it acquired from the server. If it has
  38. /// acquired the lease as a result of SARR exchange, it will use this lease
  39. /// when the Rebind process is triggered by the unit test.
  40. ///
  41. /// The client exposes a set of functions which simulate different exchange
  42. /// types between the client and the server. It also provides the access to
  43. /// the objects encapsulating responses from the server so as it is possible
  44. /// to verify from the unit test that the server's response is correct.
  45. ///
  46. /// @todo This class has been implemented to simplify the structure of the
  47. /// unit test and to make unit tests code self-explanatory. Currently,
  48. /// this class is mostly used by the unit tests which test Rebind processing
  49. /// logic. At some point we may want to use this class to test some other
  50. /// message types, e.g. Renew, in which case it may need to be extended.
  51. /// Also, once we implement the support for multiple IAAddr and IAPrefix
  52. /// options within single IA, the logic which maintains leases will have
  53. /// to be extended to support it.
  54. class Dhcp6Client : public boost::noncopyable {
  55. public:
  56. /// @brief Holds an information about single lease.
  57. struct LeaseInfo {
  58. /// @brief A structure describing the lease.
  59. Lease6 lease_;
  60. /// @brief Holds the last status code that server has sent for
  61. /// the particular lease.
  62. uint16_t status_code_;
  63. /// @brief Default constructor for the structure.
  64. LeaseInfo() :
  65. lease_(), status_code_(0) { }
  66. };
  67. /// @brief Holds the current client configuration obtained from the
  68. /// server over DHCP.
  69. ///
  70. /// Currently it simply contains the collection of leases acquired
  71. /// and a list of options. Note: this is a simple copy of all
  72. /// non-IA options and often includes "protocol" options, like
  73. /// server-id and client-id.
  74. struct Configuration {
  75. /// @brief List of received leases
  76. std::vector<LeaseInfo> leases_;
  77. /// @brief List of received options
  78. OptionCollection options_;
  79. /// @brief Status code received in the global option scope.
  80. uint16_t status_code_;
  81. /// @brief Indicates if the status code has been received in the
  82. /// last transaction.
  83. bool received_status_code_;
  84. /// @brief Constructor.
  85. Configuration() {
  86. clear();
  87. }
  88. /// @brief Clears configuration.
  89. void clear() {
  90. leases_.clear();
  91. resetGlobalStatusCode();
  92. }
  93. /// @brief Clears global status code.
  94. ///
  95. /// This function should be called before the new message is received.
  96. void resetGlobalStatusCode() {
  97. status_code_ = 0;
  98. received_status_code_ = false;
  99. }
  100. /// @brief Finds an option with the specific code in the received
  101. /// configuration.
  102. ///
  103. /// @param code Option code.
  104. ///
  105. /// @return Pointer to the option if the option exists, or NULL if
  106. /// the option doesn't exist.
  107. OptionPtr findOption(const uint16_t code) const {
  108. std::multimap<unsigned int, OptionPtr>::const_iterator it = options_.find(code);
  109. if (it != options_.end()) {
  110. return (it->second);
  111. }
  112. return (OptionPtr());
  113. }
  114. };
  115. /// @brief Holds the DHCPv6 messages taking part in transaction between
  116. /// the client and the server.
  117. struct Context {
  118. /// @brief Holds the last sent message from the client to the server.
  119. Pkt6Ptr query_;
  120. /// @brief Holds the last sent message by the server to the client.
  121. Pkt6Ptr response_;
  122. };
  123. /// @brief Creates a new client.
  124. ///
  125. /// This constructor initializes the class members to default values:
  126. /// - relay link-addr = 3000:1::1
  127. /// - first transaction id = 0
  128. /// - dest-addr = All_DHCP_Relay_Agents_and_Servers
  129. /// - duid (LLT) = <random 4 bytes>00010203040506
  130. /// - link-local-addr = fe80::3a60:77ff:fed5:cdef
  131. /// - IA_NA not requested
  132. /// - IA_PD not requested
  133. /// - not relayed
  134. Dhcp6Client();
  135. /// @brief Creates a new client that communicates with a specified server.
  136. ///
  137. /// This constructor allows passing a pointer to the server object which
  138. /// should be used in a test. The server may be preconfigured before passed
  139. /// to the constructor. The default configuration used by the client is:
  140. /// - relay link-addr = 3000:1::1
  141. /// - first transaction id = 0
  142. /// - dest-addr = All_DHCP_Relay_Agents_and_Servers
  143. /// - duid (LLT) = <random 4 bytes>00010203040506
  144. /// - link-local-addr = fe80::3a60:77ff:fed5:cdef
  145. /// - IA_NA not requested
  146. /// - IA_PD not requested
  147. /// - not relayed
  148. ///
  149. /// @param srv Object representing server under test.
  150. Dhcp6Client(boost::shared_ptr<isc::test::NakedDhcpv6Srv>& srv);
  151. /// @brief Create lease for the client.
  152. ///
  153. /// This function creates new lease on the client side without contacting
  154. /// the server. This may be useful for the negative tests in which the
  155. /// client is supposed to send invalid addresses/prefixes to the server
  156. /// and expect certain responses.
  157. ///
  158. /// @param lease A lease to be applied for the client.
  159. void createLease(const Lease6& lease);
  160. /// @brief Performs a 4-way exchange between the client and the server.
  161. ///
  162. /// If the 4-way exchange is successful, the client should acquire leases
  163. /// according to the server's current configuration and the type of leases
  164. /// that have been requested (IA_NA, IA_PD).
  165. ///
  166. /// The leases acquired are accessible through the @c config_ member.
  167. ///
  168. /// @throw This function doesn't throw exceptions on its own, but it calls
  169. /// functions that are not exception safe, so it may throw exceptions if
  170. /// error occurs.
  171. ///
  172. /// @todo Perform sanity checks on returned messages.
  173. void doSARR();
  174. /// @brief Send Solicit and receive Advertise.
  175. ///
  176. /// This function simulates the first transaction of the 4-way exchange,
  177. /// i.e. sends a Solicit to the server and receives Advertise. It doesn't
  178. /// set the lease configuration in the @c config_.
  179. ///
  180. /// @throw This function doesn't throw exceptions on its own, but it calls
  181. /// functions that are not exception safe, so it may throw exceptions if
  182. /// error occurs.
  183. ///
  184. /// @todo Perform sanity checks on returned messages.
  185. void doSolicit();
  186. /// @brief Sends a Renew to the server and receives the Reply.
  187. ///
  188. /// This function simulates sending the Renew message to the server and
  189. /// receiving server's response (if any). The client uses existing leases
  190. /// (either address or prefixes) and places them in the Renew message.
  191. /// If the server responds to the Renew (and extends the lease lifetimes)
  192. /// the current lease configuration is updated.
  193. ///
  194. /// @throw This function doesn't throw exceptions on its own, but it calls
  195. /// functions that are not exception safe, so it may throw exceptions if
  196. /// error occurs.
  197. ///
  198. /// @todo Perform sanity checks on returned messages.
  199. void doRenew();
  200. /// @brief Sends a Rebind to the server and receives the Reply.
  201. ///
  202. /// This function simulates sending the Rebind message to the server and
  203. /// receiving server's response (if any). The client uses existing leases
  204. /// (either address or prefixes) and places them in the Rebind message.
  205. /// If the server responds to the Rebind (and extends the lease lifetimes)
  206. /// the current lease configuration is updated.
  207. ///
  208. /// @throw This function doesn't throw exceptions on its own, but it calls
  209. /// functions that are not exception safe, so it may throw exceptions if
  210. /// error occurs.
  211. ///
  212. /// @todo Perform sanity checks on returned messages.
  213. void doRebind();
  214. /// @brief Sends Request to the server and receives Reply.
  215. ///
  216. /// This function simulates sending the Request message to the server and
  217. /// receiving server's response (if any). The client copies IA options
  218. /// from the current context (server's Advertise) to request acquisition
  219. /// of offered IAs. If the server responds to the Request (leases are
  220. /// acquired) the client's lease configuration is updated.
  221. ///
  222. /// @throw This function doesn't throw exceptions on its own, but it calls
  223. /// functions that are not exception safe, so it may throw exceptions if
  224. /// error occurs.
  225. ///
  226. /// @todo Perform sanity checks on returned messages.
  227. void doRequest();
  228. /// @brief Sends Confirm to the server and receives Reply.
  229. ///
  230. /// This function simulates sending the Confirm message to the server and
  231. /// receiving server's response (if any).
  232. void doConfirm();
  233. /// @brief Performs stateless (inf-request / reply) exchange.
  234. ///
  235. /// This function generates Information-request message, sends it
  236. /// to the server and then receives the reply. Contents of the Inf-Request
  237. /// are controlled by use_na_, use_pd_, use_client_id_ and use_oro_
  238. /// fields. This method does not process the response in any specific
  239. /// way, just stores it.
  240. void doInfRequest();
  241. /// @brief Removes the stateful configuration obtained from the server.
  242. ///
  243. /// It removes all leases held by the client.
  244. void clearConfig() {
  245. config_.clear();
  246. }
  247. /// @brief Simulates aging of leases by the specified number of seconds.
  248. ///
  249. /// This function moves back the time of acquired leases by the specified
  250. /// number of seconds. It is useful for checking whether the particular
  251. /// lease has been later updated (e.g. as a result of Rebind) as it is
  252. /// expected that the fresh lease has cltt set to "now" (not to the time
  253. /// in the past).
  254. void fastFwdTime(const uint32_t secs);
  255. /// @brief Returns DUID option used by the client.
  256. OptionPtr getClientId() const;
  257. /// @brief Returns current context.
  258. const Context& getContext() const {
  259. return (context_);
  260. }
  261. /// @brief Returns the collection of IAIDs held by the client.
  262. std::set<uint32_t> getIAIDs() const;
  263. /// @brief Returns lease at specified index.
  264. ///
  265. /// @warning This method doesn't check if the specified index is out of
  266. /// range. The caller is responsible for using a correct offset by
  267. /// invoking the @c getLeaseNum function.
  268. ///
  269. /// @param at Index of the lease held by the client.
  270. /// @return A lease at the specified index.
  271. Lease6 getLease(const size_t at) const {
  272. return (config_.leases_[at].lease_);
  273. }
  274. /// @brief Returns collection of leases for specified IAID.
  275. ///
  276. /// @param iaid IAID for which the leases should be returned.
  277. ///
  278. /// @return Vector containing leases for the IAID.
  279. std::vector<Lease6> getLeasesByIAID(const uint32_t iaid) const;
  280. /// @brief Returns the value of the global status code for the last
  281. /// transaction.
  282. uint16_t getStatusCode() const {
  283. return (config_.status_code_);
  284. }
  285. /// @brief Returns status code set by the server for the lease.
  286. ///
  287. /// @warning This method doesn't check if the specified index is out of
  288. /// range. The caller is responsible for using a correct offset by
  289. /// invoking the @c getLeaseNum function.
  290. ///
  291. /// @param at Index of the lease held by the client.
  292. /// @return A status code for the lease at the specified index.
  293. uint16_t getStatusCode(const size_t at) const {
  294. return (config_.leases_[at].status_code_);
  295. }
  296. /// @brief Returns number of acquired leases.
  297. size_t getLeaseNum() const {
  298. return (config_.leases_.size());
  299. }
  300. /// @brief Returns the server that the client is communicating with.
  301. boost::shared_ptr<isc::test::NakedDhcpv6Srv> getServer() const {
  302. return (srv_);
  303. }
  304. /// @brief Sets the client's DUID from a string value
  305. ///
  306. /// Replaces the client's DUID with one constructed from the given
  307. /// string. The string is expected to contain hexadecimal digits with or
  308. /// without ":" separators.
  309. ///
  310. /// @param str The string of digits from which to create the DUID
  311. ///
  312. /// The DUID modification affects the value returned by the
  313. /// @c Dhcp6Client::getClientId
  314. void setDUID(const std::string& duid_str);
  315. /// @brief Modifies the client's DUID (adds one to it).
  316. ///
  317. /// The DUID should be modified to test negative scenarios when the client
  318. /// acquires a lease and tries to renew it with a different DUID. The server
  319. /// should detect the DUID mismatch and react accordingly.
  320. ///
  321. /// The DUID modification affects the value returned by the
  322. /// @c Dhcp6Client::getClientId
  323. void modifyDUID();
  324. /// @brief Checks if the global status code was received in the response
  325. /// from the server.
  326. ///
  327. /// @return true if the global status code option was received.
  328. bool receivedStatusCode() const {
  329. return (config_.received_status_code_);
  330. }
  331. /// @brief Sets destination address for the messages being sent by the
  332. /// client.
  333. ///
  334. /// By default, the client uses All_DHCP_Relay_Agents_and_Servers
  335. /// multicast address to communicate with the server. In certain cases
  336. /// it may be desired that different address is used (e.g. unicast in Renew).
  337. /// This function sets the new address for all future exchanges with the
  338. /// server.
  339. ///
  340. /// @param dest_addr New destination address.
  341. void setDestAddress(const asiolink::IOAddress& dest_addr) {
  342. dest_addr_ = dest_addr;
  343. }
  344. /// @brief Sets the interface to be used by the client.
  345. ///
  346. /// @param iface_name Interface name.
  347. void setInterface(const std::string& iface_name) {
  348. iface_name_ = iface_name;
  349. }
  350. /// @brief Sets a prefix hint to be sent to a server.
  351. ///
  352. /// @param pref_lft Preferred lifetime.
  353. /// @param valid_lft Valid lifetime.
  354. /// @param len Prefix length.
  355. /// @param prefix Prefix for which the client has a preference.
  356. void useHint(const uint32_t pref_lft, const uint32_t valid_lft,
  357. const uint8_t len, const std::string& prefix);
  358. /// @brief Place IA_NA options to request address assignment.
  359. ///
  360. /// This function configures the client to place IA_NA options in its
  361. /// Solicit messages to request the IPv6 address assignment.
  362. ///
  363. /// @param use Parameter which 'true' value indicates that client should
  364. /// request address assignment.
  365. void useNA(const bool use = true) {
  366. use_na_ = use;
  367. }
  368. /// @brief Place IA_PD options to request prefix assignment.
  369. ///
  370. /// This function configures the client to place IA_PD options in its
  371. /// Solicit messages to request the IPv6 address assignment.
  372. ///
  373. /// @param use Parameter which 'true' value indicates that client should
  374. /// request prefix assignment.
  375. void usePD(const bool use = true) {
  376. use_pd_ = use;
  377. }
  378. /// @brief Simulate sending messages through a relay.
  379. ///
  380. /// @param use Parameter which 'true' value indicates that client should
  381. /// simulate sending messages via relay.
  382. /// @param link_addr Relay link-addr.
  383. void useRelay(const bool use = true,
  384. const asiolink::IOAddress& link_addr = asiolink::IOAddress("3000:1::1")) {
  385. use_relay_ = use;
  386. relay_link_addr_ = link_addr;
  387. }
  388. /// @brief Controls whether the client should send a client-id or not
  389. /// @param send should the client-id be sent?
  390. void useClientId(const bool send) {
  391. use_client_id_ = send;
  392. }
  393. /// @brief Specifies if the Rapid Commit option should be included in
  394. /// the Solicit message.
  395. ///
  396. /// @param rapid_commit Boolean parameter controlling if the Rapid Commit
  397. /// option must be included in the Solicit (if true), or not (if false).
  398. void useRapidCommit(const bool rapid_commit) {
  399. use_rapid_commit_ = rapid_commit;
  400. }
  401. /// @brief Specifies server-id to be used in send messages
  402. ///
  403. /// Overrides the server-id to be sent when server-id is expected to be
  404. /// sent. May be NULL, which means use proper server-id sent in Advertise
  405. /// (which is a normal client behavior).
  406. ///
  407. /// @param server_id server-id to be sent
  408. void useServerId(const OptionPtr& server_id) {
  409. forced_server_id_ = server_id;
  410. }
  411. /// @brief Creates an instance of the Client FQDN option to be included
  412. /// in the client's message.
  413. ///
  414. /// @param flags Flags.
  415. /// @param fqdn_name Name in the textual format.
  416. /// @param fqdn_type Type of the name (fully qualified or partial).
  417. void useFQDN(const uint8_t flags, const std::string& fqdn_name,
  418. Option6ClientFqdn::DomainNameType fqdn_type);
  419. /// @brief Lease configuration obtained by the client.
  420. Configuration config_;
  421. /// @brief Link address of the relay to be used for relayed messages.
  422. asiolink::IOAddress relay_link_addr_;
  423. /// @brief RelayInfo (information about relays)
  424. ///
  425. /// Dhcp6Client will typically construct this info itself, but if
  426. /// it is provided here by the test, this data will be used as is.
  427. std::vector<Pkt6::RelayInfo> relay_info_;
  428. /// @brief Controls whether the client will send ORO
  429. ///
  430. /// The actual content of the ORO is specified in oro_.
  431. /// It is useful to split the actual content and the ORO sending
  432. /// decision, so we could test cases of sending empty ORO.
  433. /// @param send controls whether ORO will be sent or not.
  434. void useORO(bool send) {
  435. use_oro_ = send;
  436. }
  437. /// @brief Instructs client to request specified option in ORO
  438. ///
  439. /// @param option_code client will request this option code
  440. void requestOption(uint16_t option_code) {
  441. use_oro_ = true;
  442. oro_.push_back(option_code);
  443. }
  444. /// @brief returns client-id
  445. /// @return client-id
  446. DuidPtr getDuid() const {
  447. return (duid_);
  448. }
  449. private:
  450. /// @brief Applies the new leases for the client.
  451. ///
  452. /// This method is called when the client obtains a new configuration
  453. /// from the server in the Reply message. This function adds new leases
  454. /// or replaces existing ones, on the client's side. Client uses these
  455. /// leases in any later communication with the server when doing Renew
  456. /// or Rebind.
  457. ///
  458. /// @param reply Server response.
  459. ///
  460. /// @todo Currently this function supports one IAAddr or IAPrefix option
  461. /// within IA. We will need to extend it to support multiple options
  462. /// within a single IA once server supports that.
  463. void applyRcvdConfiguration(const Pkt6Ptr& reply);
  464. /// @brief Applies configuration for the single lease.
  465. ///
  466. /// This method is called by the @c Dhcp6Client::applyRcvdConfiguration for
  467. /// each individual lease.
  468. ///
  469. /// @param lease_info Structure holding new lease information.
  470. void applyLease(const LeaseInfo& lease_info);
  471. /// @brief Includes CLient FQDN in the client's message.
  472. ///
  473. /// This method checks if @c fqdn_ is specified and includes it in
  474. /// the client's message.
  475. void appendFQDN();
  476. /// @brief Copy IA options from one message to another.
  477. ///
  478. /// This method copies IA_NA and IA_PD options from one message to another.
  479. /// It is useful when the client needs to construct the Request message
  480. /// using addresses and prefixes returned by the client in Advertise.
  481. ///
  482. /// @param source Message from which IA options will be copied.
  483. /// @param dest Message to which IA options will be copied.
  484. ///
  485. /// @todo Add support for IA_TA.
  486. void copyIAs(const Pkt6Ptr& source, const Pkt6Ptr& dest);
  487. /// @brief Creates IA options from existing configuration.
  488. ///
  489. /// This method iterates over existing leases that client acquired and
  490. /// places corresponding IA_NA or IA_PD options into a specified message.
  491. /// This is useful to construct Renew, Rebind or Confirm message from the
  492. /// existing configuration that client has obtained using 4-way exchange.
  493. ///
  494. /// If there are no leases no IA options will be added. If the lease exists
  495. /// but any of the lifetime values is set to 0, the IA option will be added
  496. /// but the IAAddr (or IAPrefix) option will not be added.
  497. ///
  498. /// @param dest Message to which the IA options will be added.
  499. void copyIAsFromLeases(const Pkt6Ptr& dest) const;
  500. /// @brief Creates client's side DHCP message.
  501. ///
  502. /// @param msg_type Type of the message to be created.
  503. /// @return An instance of the message created.
  504. Pkt6Ptr createMsg(const uint8_t msg_type);
  505. /// @brief Generates DUID for the client.
  506. ///
  507. /// @param duid_type Type of the DUID. Currently, only LLT is accepted.
  508. /// @return Object encapsulating a DUID.
  509. DuidPtr generateDUID(DUID::DUIDType duid_type) const;
  510. /// @brief Simulates reception of the message from the server.
  511. ///
  512. /// @return Received message.
  513. Pkt6Ptr receiveOneMsg();
  514. /// @brief Simulates sending a message to the server.
  515. ///
  516. /// This function instantly triggers processing of the message by the
  517. /// server. The server's response can be gathered by invoking the
  518. /// @c receiveOneMsg function.
  519. ///
  520. /// @param msg Message to be sent.
  521. void sendMsg(const Pkt6Ptr& msg);
  522. /// @brief Current context (sent and received message).
  523. Context context_;
  524. /// @brief Current transaction id (altered on each send).
  525. uint32_t curr_transid_;
  526. /// @brief Currently used destination address.
  527. asiolink::IOAddress dest_addr_;
  528. /// @brief Currently used DUID.
  529. DuidPtr duid_;
  530. /// @brief Currently used link local address.
  531. asiolink::IOAddress link_local_;
  532. /// @brief Currently used interface.
  533. std::string iface_name_;
  534. /// @brief Pointer to the server that the client is communicating with.
  535. boost::shared_ptr<isc::test::NakedDhcpv6Srv> srv_;
  536. bool use_na_; ///< Enable address assignment.
  537. bool use_pd_; ///< Enable prefix delegation.
  538. bool use_relay_; ///< Enable relaying messages to the server.
  539. bool use_oro_; ///< Conth
  540. bool use_client_id_;
  541. bool use_rapid_commit_;
  542. /// @brief Pointer to the option holding a prefix hint.
  543. Option6IAPrefixPtr prefix_hint_;
  544. /// @brief List of options to be requested
  545. ///
  546. /// Content of this vector will be sent as ORO if use_oro_ is set
  547. /// to true. See @ref sendORO for details.
  548. std::vector<uint16_t> oro_;
  549. /// @brief forced (Overridden) value of the server-id option (may be NULL)
  550. OptionPtr forced_server_id_;
  551. /// @brief FQDN requested by the client.
  552. Option6ClientFqdnPtr fqdn_;
  553. };
  554. } // end of namespace isc::dhcp::test
  555. } // end of namespace isc::dhcp
  556. } // end of namespace isc
  557. #endif // DHCP6_CLIENT