///
/// @param pkt packet to be sent
///
+ /// @throw isc::BadValue if invalid interface specified in the packet.
+ /// @throw isc::dhcp::SocketWriteError if sendmsg() failed to send packet.
/// @return true if sending was successful
bool send(const Pkt6Ptr& pkt);
///
/// @param pkt a packet to be sent
///
+ /// @throw isc::BadValue if invalid interface specified in the packet.
+ /// @throw isc::dhcp::SocketWriteError if sendmsg() failed to send packet.
/// @return true if sending was successful
bool send(const Pkt4Ptr& pkt);
/// (in microseconds)
///
/// @throw isc::BadValue if timeout_usec is greater than one million
+ /// @throw isc::dhcp::SocketReadError if error occured when receiving a packet.
/// @return Pkt6 object representing received packet (or NULL)
Pkt6Ptr receive6(uint32_t timeout_sec, uint32_t timeout_usec = 0);
/// (in microseconds)
///
/// @throw isc::BadValue if timeout_usec is greater than one million
+ /// @throw isc::dhcp::SocketReadError if error occured when receiving a packet.
/// @return Pkt4 object representing received packet (or NULL)
Pkt4Ptr receive4(uint32_t timeout_sec, uint32_t timeout_usec = 0);
///
/// \param socket socket to be used to send the message.
/// \param preload preload mode, packets not included in statistics.
+ ///
/// \throw isc::Unexpected if failed to create new packet instance.
/// \throw isc::BadValue if MAC address has invalid length.
+ /// \throw isc::dhcp::SocketWriteError if failed to send the packet.
void sendDiscover4(const TestControlSocket& socket,
const bool preload = false);
/// \param socket socket to be used to send the message.
/// \param template_buf buffer holding template packet.
/// \param preload preload mode, packets not included in statistics.
+ ///
/// \throw isc::OutOfRange if randomization offset is out of bounds.
+ /// \throw isc::dhcp::SocketWriteError if failed to send the packet.
void sendDiscover4(const TestControlSocket& socket,
const std::vector<uint8_t>& template_buf,
const bool preload = false);
/// \param socket socket to be used to send message.
/// \param discover_pkt4 DISCOVER packet sent.
/// \param offer_pkt4 OFFER packet object.
+ ///
/// \throw isc::Unexpected if unexpected error occured.
/// \throw isc::InvalidOperation if Statistics Manager has not been
/// initialized.
+ /// \throw isc::dhcp::SocketWriteError if failed to send the packet.
void sendRequest4(const TestControlSocket& socket,
const dhcp::Pkt4Ptr& discover_pkt4,
const dhcp::Pkt4Ptr& offer_pkt4);
/// \param template_buf buffer holding template packet.
/// \param discover_pkt4 DISCOVER packet sent.
/// \param offer_pkt4 OFFER packet received.
+ ///
+ /// \throw isc::dhcp::SocketWriteError if failed to send the packet.
void sendRequest4(const TestControlSocket& socket,
const std::vector<uint8_t>& template_buf,
const dhcp::Pkt4Ptr& discover_pkt4,
/// \throw isc::Unexpected if unexpected error occured.
/// \throw isc::InvalidOperation if Statistics Manager has not been
/// initialized.
+ ///
+ /// \throw isc::dhcp::SocketWriteError if failed to send the packet.
void sendRequest6(const TestControlSocket& socket,
const dhcp::Pkt6Ptr& advertise_pkt6);
/// \param socket socket to be used to send message.
/// \param template_buf packet template buffer.
/// \param advertise_pkt6 ADVERTISE packet object.
+ ///
+ /// \throw isc::dhcp::SocketWriteError if failed to send the packet.
void sendRequest6(const TestControlSocket& socket,
const std::vector<uint8_t>& template_buf,
const dhcp::Pkt6Ptr& advertise_pkt6);
///
/// \param socket socket to be used to send the message.
/// \param preload mode, packets not included in statistics.
+ ///
/// \throw isc::Unexpected if failed to create new packet instance.
+ /// \throw isc::dhcp::SocketWriteError if failed to send the packet.
void sendSolicit6(const TestControlSocket& socket,
const bool preload = false);
/// \param socket socket to be used to send the message.
/// \param template_buf packet template buffer.
/// \param preload mode, packets not included in statistics.
+ ///
+ /// \throw isc::dhcp::SocketWriteError if failed to send the packet.
void sendSolicit6(const TestControlSocket& socket,
const std::vector<uint8_t>& template_buf,
const bool preload = false);