ipv4addr.cpp File Reference


Detailed Description

Implementation of IPV4Addr class.

Definition in file ipv4addr.cpp.

#include <hn/hnprec.h>
#include <hn/ipv4addr.h>
#include <boost/lexical_cast.hpp>
#include <netinet/in.h>
#include <arpa/inet.h>

Include dependency graph for ipv4addr.cpp:

Go to the source code of this file.


Namespaces

namespace  Socket

Functions

uint32_t makeAddr (const std::string &addr)
 Makes internet address from string.
std::string getAddr (uint32_t ip)
 Creates human-readable address from ip.
std::ostream & operator<< (std::ostream &o, const IPV4Address &a)

Function Documentation

DLLEXPORT std::string Socket::getAddr uint32_t  ip  ) 
 

Creates human-readable address from ip.

Basically this is inet_aton.

Parameters:
ip Ip address
Returns:
Human-readable address, e.g. "127.0.0.1"

Definition at line 37 of file ipv4addr.cpp.

Referenced by IPV4Address::getAddrStr().

DLLEXPORT uint32_t Socket::makeAddr const std::string &  data  ) 
 

Makes internet address from string.

Basically this is inet_ntoa()

Parameters:
data Dot-separated IP address, e.g. "127.0.0.1"
Returns:
Internet address, used in binary formats.

Definition at line 34 of file ipv4addr.cpp.

Referenced by SchedBase::SchedBase(), and IPV4Address::setAddr().

std::ostream& operator<< std::ostream &  o,
const IPV4Address a
 

Definition at line 52 of file ipv4addr.cpp.