Commit 1736d2d2 authored by Thomas Markwalder's avatar Thomas Markwalder

[3089] Added commentary and corrected doxygen errors

Added commentary to d2/tests/nc_test_utils.h::FauxServer
Corrected doxygen errors
parent a42a146e
// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -159,6 +159,7 @@ public:
/// @param name the unique label used to identify this key
/// @param algorithm the name of the encryption alogirthm this key uses.
/// (@todo This will be a fixed list of choices)
///
/// @param secret the secret component of this key
TSIGKeyInfo(const std::string& name, const std::string& algorithm,
const std::string& secret);
......
// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -373,7 +373,7 @@ protected:
/// Creates an in::A() or in:AAAA() RData instance from the NCR
/// lease address and adds it to the given RRset.
///
/// @param RRset RRset to which to add the RData
/// @param rrset RRset to which to add the RData
///
/// @throw NameChangeTransactionError if RData cannot be constructed or
/// the RData cannot be added to the given RRset.
......@@ -384,7 +384,7 @@ protected:
/// Creates an in::DHCID() RData instance from the NCR DHCID and adds
/// it to the given RRset.
///
/// @param RRset RRset to which to add the RData
/// @param rrset RRset to which to add the RData
///
/// @throw NameChangeTransactionError if RData cannot be constructed or
/// the RData cannot be added to the given RRset.
......@@ -395,7 +395,7 @@ protected:
/// Creates an in::PTR() RData instance from the NCR FQDN and adds
/// it to the given RRset.
///
/// @param RRset RRset to which to add the RData
/// @param rrset RRset to which to add the RData
///
/// @throw NameChangeTransactionError if RData cannot be constructed or
/// the RData cannot be added to the given RRset.
......
// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -44,13 +44,24 @@ public:
CORRUPT_RESP // Generate a corrupt response
};
// Reference to IOService to use for IO processing.
asiolink::IOService& io_service_;
// IP address at which to listen for requests.
const asiolink::IOAddress& address_;
// Port on which to listen for requests.
size_t port_;
// Socket on which listening is done.
SocketPtr server_socket_;
// Stores the end point of requesting client.
asio::ip::udp::endpoint remote_;
// Buffer in which received packets are stuffed.
uint8_t receive_buffer_[TEST_MSG_MAX];
// Flag which indicates if a receive has been initiated but
// not yet completed.
bool receive_pending_;
// Indicates if server is in perpetual receive mode. If true once
// a receive has been completed, a new one will be automatically
// initiated.
bool perpetual_receive_;
/// @brief Constructor
......@@ -64,7 +75,7 @@ public:
/// @brief Constructor
///
/// @param io_service IOService to be used for socket IO.
/// @param server DnServerInfo of server the DNS server. This supplies the
/// @param server DnsServerInfo of server the DNS server. This supplies the
/// server's ip address and port.
FauxServer(asiolink::IOService& io_service, DnsServerInfo& server);
......@@ -96,6 +107,7 @@ public:
const ResponseMode& response_mode,
const dns::Rcode& response_rcode);
/// @brief Returns true if a receive has been started but not completed.
bool isReceivePending() {
return receive_pending_;
}
......@@ -106,10 +118,10 @@ public:
/// This class instantiates an IOService provides a single method, runTimedIO
/// which will run the IOService for no more than a finite amount of time,
/// at least one event is executed or the IOService is stopped.
/// It provides an overridable handler for timer expiration event. It is
/// It provides an virtual handler for timer expiration event. It is
/// intended to be used as a base class for test fixtures that need to process
/// IO by providing them a consistent way to do so while retaining a safety valve
/// so tests do not hang.
/// IO by providing them a consistent way to do so while retaining a safety
/// valve so tests do not hang.
class TimedIO {
public:
IOServicePtr io_service_;
......@@ -127,7 +139,7 @@ public:
/// Stops the IOService and fails the current test.
virtual void timesUp();
/// @brief Runs IOService till time expires or at least one handler executes.
/// @brief Processes IO till time expires or at least one handler executes.
///
/// This method first polls IOService to run any ready handlers. If no
/// handlers are ready, it starts the internal time to run for the given
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment