PTLib  Version 2.10.4
PICMPSocket Class Reference

Create a socket channel that uses allows ICMP commands in the Internal Protocol. More...

#include <icmpsock.h>

Inheritance diagram for PICMPSocket:
PIPDatagramSocket PIPSocket PSocket PChannel PObject

List of all members.

Classes

class  PingInfo
 Information used by and obtained by the ping operation. More...

Public Types

Status & Information
enum  PingStatus {
  PingSuccess, NetworkUnreachable, HostUnreachable, PacketTooBig,
  RequestTimedOut, BadRoute, TtlExpiredTransmit, TtlExpiredReassembly,
  SourceQuench, MtuChange, GeneralError, NumStatuses
}
 Results of ICMP operation. More...

Public Member Functions

Construction
 PICMPSocket ()
 Create a TCP/IP protocol socket channel.
Ping
PBoolean Ping (const PString &host)
 Send an ECHO_REPLY message to the specified host and wait for a reply to be sent back.
PBoolean Ping (const PString &host, PingInfo &info)
 Send an ECHO_REPLY message to the specified host and wait for a reply to be sent back.

Protected Member Functions

const char * GetProtocolName () const
 This function returns the protocol name for the socket type.
virtual PBoolean OpenSocket ()
virtual PBoolean OpenSocket (int ipAdressFamily)
 Open an IPv4 or IPv6 socket.
PBoolean WritePing (const PString &host, PingInfo &info)
PBoolean ReadPing (PingInfo &info)

Detailed Description

Create a socket channel that uses allows ICMP commands in the Internal Protocol.


Member Enumeration Documentation

Results of ICMP operation.

Enumerator:
PingSuccess 
NetworkUnreachable 
HostUnreachable 
PacketTooBig 
RequestTimedOut 
BadRoute 
TtlExpiredTransmit 
TtlExpiredReassembly 
SourceQuench 
MtuChange 
GeneralError 
NumStatuses 

Constructor & Destructor Documentation

Create a TCP/IP protocol socket channel.

If a remote machine address or a "listening" socket is specified then the channel is also opened.


Member Function Documentation

const char* PICMPSocket::GetProtocolName ( ) const [protected, virtual]

This function returns the protocol name for the socket type.

Implements PSocket.

virtual PBoolean PICMPSocket::OpenSocket ( ) [protected, virtual]

Implements PSocket.

virtual PBoolean PICMPSocket::OpenSocket ( int  ipAdressFamily) [protected, virtual]

Open an IPv4 or IPv6 socket.

Implements PIPSocket.

PBoolean PICMPSocket::Ping ( const PString host)

Send an ECHO_REPLY message to the specified host and wait for a reply to be sent back.

Returns:
false if host not found or no response.
Parameters:
hostHost to send ping.
PBoolean PICMPSocket::Ping ( const PString host,
PingInfo info 
)

Send an ECHO_REPLY message to the specified host and wait for a reply to be sent back.

Returns:
false if host not found or no response.
Parameters:
hostHost to send ping.
infoInformation on the ping and reply.
PBoolean PICMPSocket::ReadPing ( PingInfo info) [protected]
PBoolean PICMPSocket::WritePing ( const PString host,
PingInfo info 
) [protected]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines