PInterfaceMonitorClient Class Reference

This is a base class for clients of the PInterfaceMonitor singleton object. More...

#include <psockbun.h>

Inheritance diagram for PInterfaceMonitorClient:

PSafeObject PObject PMonitoredSockets PMonitoredSocketBundle PSingleMonitoredSocket List of all members.

Public Types

typedef PIPSocket::InterfaceEntry InterfaceEntry
 DefaultPriority = 50
enum  { DefaultPriority = 50 }

Public Member Functions

 PInterfaceMonitorClient (PINDEX priority=DefaultPriority)
 ~PInterfaceMonitorClient ()
virtual PStringArray GetInterfaces (bool includeLoopBack=false, const PIPSocket::Address &destination=PIPSocket::GetDefaultIpAny())
 Get an array of all current interface descriptors, possibly including the loopback (127.0.0.1) interface.
virtual PBoolean GetInterfaceInfo (const PString &iface, InterfaceEntry &info) const
 Return information about an active interface given the descriptor string.
PINDEX GetPriority () const
 Returns the priority of this client.

Protected Member Functions

virtual void OnAddInterface (const InterfaceEntry &entry)=0
 Call back function for when an interface has been added to the system.
virtual void OnRemoveInterface (const InterfaceEntry &entry)=0
 Call back function for when an interface has been removed from the system.
virtual void OnRemoveNatMethod (const PNatMethod *)
 Called when a NAT method is about to be destroyed.

Protected Attributes

PINDEX priority

Detailed Description

This is a base class for clients of the PInterfaceMonitor singleton object.

The OnAddInterface() and OnRemoveInterface() functions are called in the context of a thread that is monitoring interfaces. The client object is locked for Read/Write before these functions are called.


Member Typedef Documentation

typedef PIPSocket::InterfaceEntry PInterfaceMonitorClient::InterfaceEntry


Member Enumeration Documentation

anonymous enum

Enumerator:
DefaultPriority 


Constructor & Destructor Documentation

PInterfaceMonitorClient::PInterfaceMonitorClient ( PINDEX  priority = DefaultPriority  ) 

PInterfaceMonitorClient::~PInterfaceMonitorClient (  ) 


Member Function Documentation

virtual PBoolean PInterfaceMonitorClient::GetInterfaceInfo ( const PString iface,
InterfaceEntry info 
) const [virtual]

Return information about an active interface given the descriptor string.

Note that when searchin the descriptor may be a partial match e.g. "10.0.1.11" or "%eth0" may be used.

Parameters:
iface  Interface desciptor name
info  Information on the interface

virtual PStringArray PInterfaceMonitorClient::GetInterfaces ( bool  includeLoopBack = false,
const PIPSocket::Address destination = PIPSocket::GetDefaultIpAny() 
) [virtual]

Get an array of all current interface descriptors, possibly including the loopback (127.0.0.1) interface.

Note the names are of the form ipname, eg "10.0.1.11%3Com 3C90x Ethernet Adapter" or "192.168.0.10%eth0". If destination is not 'any' and a filter is set, filters the interface list before returning it.

Parameters:
includeLoopBack  Flag for if loopback is to included in list
destination  Optional destination for selecting specific interface

Reimplemented in PSingleMonitoredSocket.

PINDEX PInterfaceMonitorClient::GetPriority (  )  const [inline]

Returns the priority of this client.

A higher value means higher priority. Higher priority clients get their callback functions called first. Clients with the same priority get called in the order of their insertion.

virtual void PInterfaceMonitorClient::OnAddInterface ( const InterfaceEntry entry  )  [protected, pure virtual]

Call back function for when an interface has been added to the system.

virtual void PInterfaceMonitorClient::OnRemoveInterface ( const InterfaceEntry entry  )  [protected, pure virtual]

Call back function for when an interface has been removed from the system.

virtual void PInterfaceMonitorClient::OnRemoveNatMethod ( const PNatMethod  )  [inline, protected, virtual]

Called when a NAT method is about to be destroyed.

Reimplemented in PMonitoredSockets.


Member Data Documentation

PINDEX PInterfaceMonitorClient::priority [protected]


The documentation for this class was generated from the following file:
Generated on Fri Oct 14 01:44:12 2011 for PTLib by  doxygen 1.4.7