ipsock.h
Go to the documentation of this file.
/*
* ipsock.h
*
* Internet Protocol socket I/O channel class.
*
* Portable Tools Library
*
* Copyright (c) 1993-1998 Equivalence Pty. Ltd.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Portable Windows Library.
*
* The Initial Developer of the Original Code is Equivalence Pty. Ltd.
*
* Portions are Copyright (C) 1993 Free Software Foundation, Inc.
* All Rights Reserved.
*
* Contributor(s): ______________________________________.
*
* $Revision: 28179 $
* $Author: rjongbloed $
* $Date: 2012-08-10 06:23:27 -0500 (Fri, 10 Aug 2012) $
*/
#ifndef PTLIB_IPSOCKET_H
#define PTLIB_IPSOCKET_H
#ifdef P_USE_PRAGMA
#pragma interface
#endif
#include <ptlib/socket.h>
#if P_QOS
#ifdef _WIN32
#ifdef P_KNOCKOUT_WINSOCK2
#include "IPExport.h"
#endif // KNOCKOUT_WINSOCK2
#endif // _WIN32
#endif // P_QOS
class PIPSocketAddressAndPort;
class PIPSocket : public PSocket
{
PCLASSINFO(PIPSocket, PSocket);
protected:
PIPSocket();
public:
class Address : public PObject {
public:
Address();
Address(const PString & dotNotation);
Address(PINDEX len, const BYTE * bytes);
Address(BYTE b1, BYTE b2, BYTE b3, BYTE b4);
Address(DWORD dw);
Address(const in_addr & addr);
#if P_HAS_IPV6
Address(const in6_addr & addr);
#endif
Address(const int ai_family, const int ai_addrlen,struct sockaddr *ai_addr);
#ifdef __NUCLEUS_NET__
Address(const struct id_struct & addr);
Address & operator=(const struct id_struct & addr);
#endif
Address & operator=(const in_addr & addr);
#if P_HAS_IPV6
Address & operator=(const in6_addr & addr);
#endif
Address & operator=(const PString & dotNotation);
Address & operator=(DWORD dw);
Comparison Compare(const PObject & obj) const;
bool operator==(const Address & addr) const { return Compare(addr) == EqualTo; }
bool operator!=(const Address & addr) const { return Compare(addr) != EqualTo; }
#if P_HAS_IPV6
bool operator==(in6_addr & addr) const;
bool operator!=(in6_addr & addr) const { return !operator==(addr); }
#endif
bool operator==(in_addr & addr) const;
bool operator!=(in_addr & addr) const { return !operator==(addr); }
bool operator==(DWORD dw) const;
bool operator!=(DWORD dw) const { return !operator==(dw); }
#ifdef P_VXWORKS
bool operator==(long unsigned int u) const { return operator==((DWORD)u); }
bool operator!=(long unsigned int u) const { return !operator==((DWORD)u); }
#endif
#ifdef _WIN32
bool operator==(unsigned u) const { return operator==((DWORD)u); }
bool operator!=(unsigned u) const { return !operator==((DWORD)u); }
#endif
#ifdef P_RTEMS
bool operator==(u_long u) const { return operator==((DWORD)u); }
bool operator!=(u_long u) const { return !operator==((DWORD)u); }
#endif
#ifdef P_BEOS
bool operator==(in_addr_t a) const { return operator==((DWORD)a); }
bool operator!=(in_addr_t a) const { return !operator==((DWORD)a); }
#endif
bool operator==(int i) const { return operator==((DWORD)i); }
bool operator!=(int i) const { return !operator==((DWORD)i); }
#if P_HAS_IPV6
bool operator*=(const Address & addr) const;
#else
bool operator*=(const Address & addr) const { return operator==(addr); }
#endif
PString AsString(
bool bracketIPv6 = false
) const;
PBoolean FromString(
const PString & str
);
operator PString() const;
operator in_addr() const;
#if P_HAS_IPV6
operator in6_addr() const;
#endif
operator DWORD() const;
BYTE Byte1() const;
BYTE Byte2() const;
BYTE Byte3() const;
BYTE Byte4() const;
BYTE operator[](PINDEX idx) const;
PINDEX GetSize() const;
const char * GetPointer() const { return (const char *)&v; }
unsigned GetVersion() const { return version; }
PBoolean IsValid() const;
PBoolean IsAny() const;
PBoolean IsLoopback() const;
PBoolean IsBroadcast() const;
PBoolean IsMulticast() const;
PBoolean IsRFC1918() const ;
#if P_HAS_IPV6
PBoolean IsV4Mapped() const;
PBoolean IsLinkLocal() const;
#endif
static const Address & GetLoopback(int version = 4);
static const Address & GetAny(int version = 4);
static const Address GetBroadcast(int version = 4);
protected:
union {
in_addr four;
#if P_HAS_IPV6
in6_addr six;
#endif
} v;
unsigned version;
friend ostream & operator<<(ostream & s, const Address & a);
friend istream & operator>>(istream & s, Address & a);
};
//**@name Overrides from class PChannel */
virtual PString GetName() const;
static int GetDefaultIpAddressFamily();
static void SetDefaultIpAddressFamily(int ipAdressFamily); // PF_INET, PF_INET6
static void SetDefaultIpAddressFamilyV4(); // PF_INET
#if P_HAS_IPV6
static void SetDefaultIpAddressFamilyV6(); // PF_INET6
static PBoolean IsIpAddressFamilyV6Supported();
static void SetDefaultV6ScopeId(int scopeId); // local-link adresses require one
static int GetDefaultV6ScopeId();
#endif
static PIPSocket::Address GetDefaultIpAny();
static void SetSuppressCanonicalName(bool suppress);
static bool GetSuppressCanonicalName();
virtual PBoolean OpenSocket(
int ipAdressFamily=PF_INET
) = 0;
virtual PBoolean Connect(
const PString & address
);
virtual PBoolean Connect(
const Address & addr
);
virtual PBoolean Connect(
WORD localPort,
const Address & addr
);
virtual PBoolean Connect(
const Address & iface,
const Address & addr
);
virtual PBoolean Connect(
const Address & iface,
WORD localPort,
const Address & addr
);
virtual PBoolean Listen(
unsigned queueSize = 5,
WORD port = 0,
Reusability reuse = AddressIsExclusive
);
virtual PBoolean Listen(
const Address & bind,
unsigned queueSize = 5,
WORD port = 0,
Reusability reuse = AddressIsExclusive
);
static PString GetHostName();
static PString GetHostName(
const PString & hostname
);
static PString GetHostName(
const Address & addr
);
static PBoolean GetHostAddress(
Address & addr
);
static PBoolean GetHostAddress(
const PString & hostname,
Address & addr
);
static PStringArray GetHostAliases(
const PString & hostname
);
static PStringArray GetHostAliases(
const Address & addr
/* Name of host to get address for. This may be either a domain name or
an IP number in "dot" format.
*/
);
static PBoolean IsLocalHost(
const PString & hostname
);
virtual PString GetLocalAddress();
virtual PBoolean GetLocalAddress(
Address & addr
);
virtual PBoolean GetLocalAddress(
PIPSocketAddressAndPort & addr
);
virtual PBoolean GetLocalAddress(
Address & addr,
WORD & port
);
virtual PString GetPeerAddress();
virtual PBoolean GetPeerAddress(
Address & addr
);
virtual PBoolean GetPeerAddress(
PIPSocketAddressAndPort & addr
);
virtual PBoolean GetPeerAddress(
Address & addr,
WORD & port
);
PString GetLocalHostName();
PString GetPeerHostName();
static void ClearNameCache();
static PBoolean GetGatewayAddress(
Address & addr,
int version = 4
);
static PString GetGatewayInterface(int version = 4);
static PIPSocket::Address GetRouteInterfaceAddress(PIPSocket::Address remoteAddress);
#ifdef _WIN32
static PIPSocket::Address GetGatewayInterfaceAddress(int version = 4);
static PIPSocket::Address GetRouteAddress(PIPSocket::Address RemoteAddress);
static unsigned AsNumeric(Address addr);
static PBoolean IsAddressReachable(PIPSocket::Address LocalIP,
PIPSocket::Address LocalMask,
PIPSocket::Address RemoteIP);
static PString GetInterface(PIPSocket::Address addr);
#endif
class RouteEntry : public PObject
{
PCLASSINFO(RouteEntry, PObject);
public:
RouteEntry(const Address & addr) : network(addr) { }
Address GetNetwork() const { return network; }
Address GetNetMask() const { return net_mask; }
Address GetDestination() const { return destination; }
const PString & GetInterface() const { return interfaceName; }
long GetMetric() const { return metric; }
protected:
Address network;
Address net_mask;
Address destination;
PString interfaceName;
long metric;
friend class PIPSocket;
};
PARRAY(RouteTable, RouteEntry);
static PBoolean GetRouteTable(
RouteTable & table
);
class RouteTableDetector
{
public:
virtual ~RouteTableDetector() { }
virtual bool Wait(
const PTimeInterval & timeout
) = 0;
virtual void Cancel() = 0;
};
static RouteTableDetector * CreateRouteTableDetector();
class InterfaceEntry : public PObject
{
PCLASSINFO(InterfaceEntry, PObject)
public:
InterfaceEntry();
InterfaceEntry(
const PString & name,
const Address & addr,
const Address & mask,
const PString & macAddr
);
virtual void PrintOn(
ostream &strm // Stream to print the object into.
) const;
const PString & GetName() const { return m_name; }
Address GetAddress() const { return m_ipAddress; }
Address GetNetMask() const { return m_netMask; }
const PString & GetMACAddress() const { return m_macAddress; }
static void SanitiseName(PString & name);
protected:
PString m_name;
Address m_ipAddress;
Address m_netMask;
PString m_macAddress;
friend class PIPSocket;
};
PARRAY(InterfaceTable, InterfaceEntry);
static PBoolean GetInterfaceTable(
InterfaceTable & table,
PBoolean includeDown = false
);
static PBoolean GetNetworkInterface(PIPSocket::Address & addr);
#if P_HAS_RECVMSG
PBoolean SetCaptureReceiveToAddress()
{ if (!SetOption(IP_PKTINFO, 1, SOL_IP)) return false; catchReceiveToAddr = true; return true; }
PIPSocket::Address GetLastReceiveToAddress() const
{ return lastReceiveToAddr; }
protected:
void SetLastReceiveAddr(void * addr, int addrLen)
{ if (addrLen == sizeof(in_addr)) lastReceiveToAddr = *(in_addr *)addr; }
PIPSocket::Address lastReceiveToAddr;
#else
PBoolean SetCaptureReceiveToAddress()
{ return false; }
PIPSocket::Address GetLastReceiveToAddress() const
{ return PIPSocket::Address(); }
#endif
// Include platform dependent part of class
#ifdef _WIN32
#include "msos/ptlib/ipsock.h"
#else
#include "unix/ptlib/ipsock.h"
#endif
};
class PIPSocketAddressAndPort
{
public:
PIPSocketAddressAndPort()
: m_port(0), m_separator(':')
{ }
PIPSocketAddressAndPort(char separator)
: m_port(0), m_separator(separator)
{ }
PIPSocketAddressAndPort(const PString & str, WORD defaultPort = 0, char separator = ':')
: m_port(defaultPort), m_separator(separator)
{ Parse(str, defaultPort, m_separator); }
PBoolean Parse(const PString & str, WORD defaultPort = 0, char separator = ':');
PString AsString(char separator = 0) const
{ return m_address.AsString() + (separator ? separator : m_separator) + PString(PString::Unsigned, m_port); }
void SetAddress(
const PIPSocket::Address & addr,
WORD port = 0
);
const PIPSocket::Address & GetAddress() const { return m_address; }
WORD GetPort() const { return m_port; }
void SetPort(
WORD port
) { m_port = port; }
bool IsValid() const { return m_address.IsValid() && m_port != 0; }
friend ostream & operator<<(ostream & strm, const PIPSocketAddressAndPort & ap)
{
return strm << ap.m_address << ap.m_separator << ap.m_port;
}
protected:
PIPSocket::Address m_address;
WORD m_port;
char m_separator;
};
typedef std::vector<PIPSocketAddressAndPort> PIPSocketAddressAndPortVector;
#endif // PTLIB_IPSOCKET_H
// End Of File ///////////////////////////////////////////////////////////////
PIPSocket::RouteTableDetector
Class for detector of Route Table changes.
Definition: ipsock.h:620
PIPSocket::Address::GetBroadcast
static const Address GetBroadcast(int version=4)
PIPSocket::Address::AsString
PString AsString(bool bracketIPv6=false) const
Format an address as a string.
PIPSocket::RouteEntry::GetInterface
const PString & GetInterface() const
Get the network address name associated with the route table entry.
Definition: ipsock.h:593
PIPSocket::RouteEntry::interfaceName
PString interfaceName
Definition: ipsock.h:602
PSocket::AddressIsExclusive
Definition: socket.h:86
PIPSocket::Address::operator[]
BYTE operator[](PINDEX idx) const
Return specified byte of IPv4 or IPv6 address.
PIPSocket::Address::Compare
Comparison Compare(const PObject &obj) const
Compare two adresses for absolute (in)equality.
PIPSocketAddressAndPort::PIPSocketAddressAndPort
PIPSocketAddressAndPort(const PString &str, WORD defaultPort=0, char separator=':')
Definition: ipsock.h:764
PIPSocket::InterfaceEntry::GetAddress
Address GetAddress() const
Get the address associated with the interface.
Definition: ipsock.h:672
PIPSocket::GetGatewayInterface
static PString GetGatewayInterface(int version=4)
Get the name for the interface that is being used as the gateway, that is, the interface that packets...
PIPSocket::Listen
virtual PBoolean Listen(unsigned queueSize=5, WORD port=0, Reusability reuse=AddressIsExclusive)
Listen on a socket for a remote host on the specified port number.
PIPSocket::RouteEntry::net_mask
Address net_mask
Definition: ipsock.h:600
PObject::EqualTo
Definition: object.h:1186
PIPSocketAddressAndPort::AsString
PString AsString(char separator=0) const
Definition: ipsock.h:770
PTimeInterval
This class defines an arbitrary time interval to millisecond accuracy.
Definition: timeint.h:55
PCLASSINFO
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:1049
PIPSocket::GetName
virtual PString GetName() const
Get the platform and I/O channel type name of the channel.
PIPSocket::GetDefaultIpAddressFamily
static int GetDefaultIpAddressFamily()
Set the default IP address familly.
PIPSocket::Address::FromString
PBoolean FromString(const PString &str)
Convert string to IP address. Returns true if was a valid address.
PIPSocket::IsLocalHost
static PBoolean IsLocalHost(const PString &hostname)
Determine if the specified host is actually the local machine.
PIPSocket::InterfaceEntry::GetNetMask
Address GetNetMask() const
Get the net mask associated with the interface.
Definition: ipsock.h:675
PIPSocket::GetLastReceiveToAddress
PIPSocket::Address GetLastReceiveToAddress() const
Return the interface address of the last incoming packet.
Definition: ipsock.h:740
PIPSocket::GetGatewayAddress
static PBoolean GetGatewayAddress(Address &addr, int version=4)
Get the IP address that is being used as the gateway, that is, the computer that packets on the defau...
PIPSocket::Address::operator<<
friend ostream & operator<<(ostream &s, const Address &a)
Output IPv6 & IPv4 address as a string to the specified string.
PIPSocketAddressAndPort::IsValid
bool IsValid() const
Definition: ipsock.h:783
PIPSocketAddressAndPort::GetAddress
const PIPSocket::Address & GetAddress() const
Definition: ipsock.h:777
PIPSocket::CreateRouteTableDetector
static RouteTableDetector * CreateRouteTableDetector()
Create an object that can wait for a change in the route table or active network interfaces.
PIPSocket::InterfaceEntry
Describe an interface table entry.
Definition: ipsock.h:642
PIPSocket::RouteEntry::GetMetric
long GetMetric() const
Get the network metric associated with the route table entry.
Definition: ipsock.h:596
PIPSocket::Address::operator!=
bool operator!=(in_addr &addr) const
Definition: ipsock.h:138
PIPSocket::GetHostAddress
static PBoolean GetHostAddress(Address &addr)
Get the Internet Protocol address for the specified host, or if none specified, for the host this pro...
PIPSocket::Address::GetAny
static const Address & GetAny(int version=4)
PIPSocket
This class describes a type of socket that will communicate using the Internet Protocol.
Definition: ipsock.h:63
PIPSocket::Address::Byte3
BYTE Byte3() const
Return third byte of IPv4 address.
PObject::Comparison
Comparison
Result of the comparison operation performed by the Compare() function.
Definition: object.h:1184
PIPSocket::InterfaceEntry::m_netMask
Address m_netMask
Definition: ipsock.h:686
PIPSocket::Address::IsRFC1918
PBoolean IsRFC1918() const
Check if the remote address is a private address.
PIPSocket::GetLocalAddress
virtual PString GetLocalAddress()
Get the Internet Protocol address and port for the local host.
PIPSocket::Address::operator>>
friend istream & operator>>(istream &s, Address &a)
Input IPv4 (not IPv6 yet!) address as a string from the specified string.
PIPSocket::InterfaceEntry::m_ipAddress
Address m_ipAddress
Definition: ipsock.h:685
PIPSocket::SetSuppressCanonicalName
static void SetSuppressCanonicalName(bool suppress)
Set flag for suppress getting canonical name when doing lookup via hostname.
PIPSocket::Address::operator==
bool operator==(int i) const
Definition: ipsock.h:157
PStringArray
This is an array collection class of PString objects.
Definition: pstring.h:2024
PIPSocket::Address::IsMulticast
PBoolean IsMulticast() const
Check if address is multicast group.
PIPSocket::Address::Byte4
BYTE Byte4() const
Return fourth byte of IPv4 address.
PIPSocket::InterfaceEntry::GetName
const PString & GetName() const
Get the name of the interface.
Definition: ipsock.h:669
PSocket::port
WORD port
Port to be used by the socket when opening the channel.
Definition: socket.h:444
PIPSocket::GetPeerHostName
PString GetPeerHostName()
Get the host name for the peer host the socket is connected to.
PIPSocket::GetSuppressCanonicalName
static bool GetSuppressCanonicalName()
Get flag for suppress getting canonical name when doing lookup via hostname.
PIPSocketAddressAndPort::PIPSocketAddressAndPort
PIPSocketAddressAndPort(char separator)
Definition: ipsock.h:760
PIPSocket::Address::four
in_addr four
Definition: ipsock.h:254
PIPSocket::RouteEntry::GetNetwork
Address GetNetwork() const
Get the network address associated with the route table entry.
Definition: ipsock.h:584
PIPSocket::Address::Byte1
BYTE Byte1() const
Return first byte of IPv4 address.
PObject::PrintOn
virtual void PrintOn(ostream &strm) const
Output the contents of the object to the stream.
PIPSocket::InterfaceEntry::m_macAddress
PString m_macAddress
Definition: ipsock.h:687
PBoolean
BOOL PBoolean
Definition: object.h:102
PIPSocket::GetRouteTable
static PBoolean GetRouteTable(RouteTable &table)
Get the systems route table.
PIPSocket::GetRouteInterfaceAddress
static PIPSocket::Address GetRouteInterfaceAddress(PIPSocket::Address remoteAddress)
Get the interface address that will be used to reach the specified remote address.
PIPSocket::RouteEntry::RouteEntry
RouteEntry(const Address &addr)
Create a route table entry from an IP address.
Definition: ipsock.h:581
PIPSocketAddressAndPort::m_port
WORD m_port
Definition: ipsock.h:792
PIPSocket::GetLocalHostName
PString GetLocalHostName()
Get the host name for the local host.
PIPSocket::Address::IsAny
PBoolean IsAny() const
PIPSocket::Address::GetVersion
unsigned GetVersion() const
Get the version of the IP address being used.
Definition: ipsock.h:214
PIPSocket::PIPSocket
PIPSocket()
Create a new Internet Protocol socket based on the port number specified.
PIPSocket::RouteEntry::GetNetMask
Address GetNetMask() const
Get the network address mask associated with the route table entry.
Definition: ipsock.h:587
PIPSocket::RouteEntry
Describe a route table entry.
Definition: ipsock.h:576
PIPSocket::Address::IsValid
PBoolean IsValid() const
Check address 0.0.0.0 or ::.
PIPSocket::GetNetworkInterface
static PBoolean GetNetworkInterface(PIPSocket::Address &addr)
Get the address of an interface that corresponds to a real network.
PIPSocket::InterfaceEntry::m_name
PString m_name
Definition: ipsock.h:684
PIPSocket::Address::v
union PIPSocket::Address::@5 v
Runtime test of IP addresse type.
PIPSocket::GetHostAliases
static PStringArray GetHostAliases(const PString &hostname)
Get the alias host names for the specified host.
PIPSocket::Address::operator==
bool operator==(const Address &addr) const
Definition: ipsock.h:131
PIPSocket::Address::version
unsigned version
Definition: ipsock.h:259
PIPSocket::Address::operator!=
bool operator!=(DWORD dw) const
Definition: ipsock.h:140
PSocket::OpenSocket
virtual PBoolean OpenSocket()=0
PIPSocket::Connect
virtual PBoolean Connect(const PString &address)
Connect a socket to a remote host on the specified port number.
PIPSocket::RouteTableDetector::~RouteTableDetector
virtual ~RouteTableDetector()
Definition: ipsock.h:623
PIPSocketAddressAndPort::m_address
PIPSocket::Address m_address
Definition: ipsock.h:791
PIPSocket::Address::operator!=
bool operator!=(int i) const
Definition: ipsock.h:158
PIPSocket::SetDefaultIpAddressFamilyV4
static void SetDefaultIpAddressFamilyV4()
PIPSocket::RouteEntry::destination
Address destination
Definition: ipsock.h:601
PIPSocket::PARRAY
PARRAY(RouteTable, RouteEntry)
PIPSocket::RouteEntry::metric
long metric
Definition: ipsock.h:603
PIPSocket::ClearNameCache
static void ClearNameCache()
Clear the name (DNS) cache.
PString
The character string class.
Definition: pstring.h:108
PIPSocketAddressAndPortVector
std::vector< PIPSocketAddressAndPort > PIPSocketAddressAndPortVector
Definition: ipsock.h:796
PIPSocket::Address::Byte2
BYTE Byte2() const
Return second byte of IPv4 address.
PIPSocketAddressAndPort
Definition: ipsock.h:753
PIPSocketAddressAndPort::SetPort
void SetPort(WORD port)
Definition: ipsock.h:779
PIPSocketAddressAndPort::operator<<
friend ostream & operator<<(ostream &strm, const PIPSocketAddressAndPort &ap)
Definition: ipsock.h:785
PIPSocket::Address::GetLoopback
static const Address & GetLoopback(int version=4)
PString::Unsigned
Definition: pstring.h:286
PIPSocketAddressAndPort::GetPort
WORD GetPort() const
Definition: ipsock.h:778
PIPSocket::GetDefaultIpAny
static PIPSocket::Address GetDefaultIpAny()
PIPSocket::Address::operator=
Address & operator=(const in_addr &addr)
Copy an address from another IP v4 address.
PIPSocket::Address
A class describing an IP address.
Definition: ipsock.h:75
PIPSocket::InterfaceEntry::GetMACAddress
const PString & GetMACAddress() const
Get the MAC address associate with the interface.
Definition: ipsock.h:678
PIPSocket::GetPeerAddress
virtual PString GetPeerAddress()
Get the Internet Protocol address for the peer host and port the socket is connected to...
PIPSocket::Address::GetSize
PINDEX GetSize() const
Get the address length (will be either 4 or 16).
PIPSocket::RouteEntry::network
Address network
Definition: ipsock.h:599
PIPSocket::Address::operator*=
bool operator*=(const Address &addr) const
Compare two addresses for equivalence.
Definition: ipsock.h:165
PIPSocket::Address::IsLoopback
PBoolean IsLoopback() const
Check address 127.0.0.1 or ::1.
PIPSocket::GetInterfaceTable
static PBoolean GetInterfaceTable(InterfaceTable &table, PBoolean includeDown=false)
Get a list of all interfaces.
PIPSocket::Address::GetPointer
const char * GetPointer() const
Get the pointer to IP address data.
Definition: ipsock.h:211
PIPSocket::GetHostName
static PString GetHostName()
Get the "official" host name for the host specified or if none, the host this process is running on...
PIPSocket::RouteEntry::GetDestination
Address GetDestination() const
Get the default gateway address associated with the route table entry.
Definition: ipsock.h:590
PSocket
A network communications channel.
Definition: socket.h:58
socket.h
PIPSocket::SetCaptureReceiveToAddress
PBoolean SetCaptureReceiveToAddress()
Set flag to capture interface address for incoming packets.
Definition: ipsock.h:735
PIPSocketAddressAndPort::PIPSocketAddressAndPort
PIPSocketAddressAndPort()
Definition: ipsock.h:756
PSocket::Reusability
Reusability
Flags to reuse of port numbers in Listen() function.
Definition: socket.h:84
PObject
Ultimate parent class for all objects in the class library.
Definition: object.h:1118
PIPSocket::Address::IsBroadcast
PBoolean IsBroadcast() const
Check for Broadcast address 255.255.255.255.
PSocket::SetOption
PBoolean SetOption(int option, int value, int level=SOL_SOCKET)
Set options on the socket.
PIPSocket::SetDefaultIpAddressFamily
static void SetDefaultIpAddressFamily(int ipAdressFamily)
PIPSocket::Address::operator!=
bool operator!=(const Address &addr) const
Definition: ipsock.h:132
PIPSocket::Address::Address
Address()
Create an IPv4 address with the default address: 127.0.0.1 (loopback).
PIPSocketAddressAndPort::m_separator
char m_separator
Definition: ipsock.h:793