return (Pkt6Ptr()); // NULL
}
- pkt->setLocalAddr(IOAddress::from_bytes(AF_INET6, reinterpret_cast<const uint8_t*>(&to_addr)));
- pkt->setRemoteAddr(IOAddress::from_bytes(AF_INET6, reinterpret_cast<const uint8_t*>(&from.sin6_addr)));
-
+ pkt->setLocalAddr(IOAddress::from_bytes(AF_INET6,
+ reinterpret_cast<const uint8_t*>(&to_addr)));
+ pkt->setRemoteAddr(IOAddress::from_bytes(AF_INET6,
+ reinterpret_cast<const uint8_t*>(&from.sin6_addr)));
pkt->setRemotePort(ntohs(from.sin6_port));
-
pkt->setIndex(ifindex);
Iface* received = getIface(pkt->getIndex());
uint16_t IfaceMgr::getSocket(const isc::dhcp::Pkt6& pkt) {
Iface* iface = getIface(pkt.getIface());
- if (!iface) {
+ if (iface == NULL) {
isc_throw(BadValue, "Tried to find socket for non-existent interface "
<< pkt.getIface());
}
SocketCollection::const_iterator s;
for (s = iface->sockets_.begin(); s != iface->sockets_.end(); ++s) {
- if ( (s->family_ == AF_INET6) &&
- (!s->addr_.getAddress().to_v6().is_multicast()) ) {
+ if ((s->family_ == AF_INET6) &&
+ (!s->addr_.getAddress().to_v6().is_multicast())) {
return (s->sockfd_);
}
/// @todo: Add more checks here later. If remote address is
uint16_t IfaceMgr::getSocket(isc::dhcp::Pkt4 const& pkt) {
Iface* iface = getIface(pkt.getIface());
- if (!iface) {
+ if (iface == NULL) {
isc_throw(BadValue, "Tried to find socket for non-existent interface "
<< pkt.getIface());
}
/// @param control_buf_len buffer length
/// @param pkt packet to be sent
void os_send4(struct msghdr& m, boost::scoped_array<char>& control_buf,
- size_t control_buf_len, const Pkt4Ptr& pkt);
+ size_t control_buf_len, const Pkt4Ptr& pkt);
/// @brief OS-specific operations during IPv4 packet reception
///
private:
- /// creates a single instance of this class (a singleton implementation)
+ /// @brief Creates a single instance of this class (a singleton implementation)
static void
instanceCreate();
#ifndef __RANGE_UTIL_H_
#define __RANGE_UTIL_H_ 1
+#include <cstdlib>
#include <algorithm>
// This header contains useful methods for conduction operations on
/// @param begin
/// @param end
template <typename Iterator>
-void fillRandom(Iterator begin, Iterator end) {
- for (Iterator x=begin; x != end; ++x) {
- *x = rand();
+void
+fillRandom(Iterator begin, Iterator end) {
+ for (Iterator x = begin; x != end; ++x) {
+ *x = std::rand();
}
}