Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

ipsock.h

Go to the documentation of this file.
00001 /*
00002  * ipsock.h
00003  *
00004  * Internet Protocol socket I/O channel class.
00005  *
00006  * Portable Windows Library
00007  *
00008  * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
00009  *
00010  * The contents of this file are subject to the Mozilla Public License
00011  * Version 1.0 (the "License"); you may not use this file except in
00012  * compliance with the License. You may obtain a copy of the License at
00013  * http://www.mozilla.org/MPL/
00014  *
00015  * Software distributed under the License is distributed on an "AS IS"
00016  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00017  * the License for the specific language governing rights and limitations
00018  * under the License.
00019  *
00020  * The Original Code is Portable Windows Library.
00021  *
00022  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
00023  *
00024  * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
00025  * All Rights Reserved.
00026  *
00027  * Contributor(s): ______________________________________.
00028  *
00029  * $Log: ipsock.h,v $
00030  * Revision 1.67.2.3  2005/02/13 23:44:03  csoutheren
00031  * Backported more IPV6 fixes from Atlas-devel
00032  *
00033  * Revision 1.75  2005/02/13 23:01:35  csoutheren
00034  * Fixed problem with not detecting mapped IPV6 addresses within the RFC1918
00035  * address range as RFC1918
00036  *
00037  * Revision 1.74  2005/02/07 12:12:33  csoutheren
00038  * Expanded interface list routines to include IPV6 addresses
00039  * Added IPV6 to GetLocalAddress
00040  *
00041  * Revision 1.67.2.2  2005/02/07 00:54:32  csoutheren
00042  * Backported latest IPV6 changes from Atlas-devel
00043  *
00044  * Revision 1.73  2005/02/07 00:47:17  csoutheren
00045  * Changed IPV6 code to use standard IPV6 macros
00046  *
00047  * Revision 1.67.2.1  2005/02/04 05:19:08  csoutheren
00048  * Backported patches from Atlas-devel
00049  *
00050  * Revision 1.72  2005/02/04 05:50:27  csoutheren
00051  * Extended IsRFC1918 to handle IPV6
00052  *
00053  * Revision 1.71  2005/01/16 21:27:01  csoutheren
00054  * Changed PIPSocket::IsAny to be const
00055  *
00056  * Revision 1.70  2004/12/20 07:59:33  csoutheren
00057  * Fixed operator *= for IPV6
00058  *
00059  * Revision 1.69  2004/12/14 14:24:19  csoutheren
00060  * Added PIPSocket::Address::operator*= to compare IPV4 addresses
00061  * to IPV4-compatible IPV6 addresses. More documentation needed
00062  * once this is tested as working
00063  *
00064  * Revision 1.68  2004/12/14 06:20:29  csoutheren
00065  * Added function to get address of network interface
00066  *
00067  * Revision 1.67  2004/08/24 07:08:13  csoutheren
00068  * Added use of recvmsg to determine which interface UDP packets arrive on
00069  *
00070  * Revision 1.66  2004/07/11 07:56:35  csoutheren
00071  * Applied jumbo VxWorks patch, thanks to Eize Slange
00072  *
00073  * Revision 1.65  2004/04/18 04:33:36  rjongbloed
00074  * Changed all operators that return BOOL to return standard type bool. This is primarily
00075  *   for improved compatibility with std STL usage removing many warnings.
00076  *
00077  * Revision 1.64  2004/04/07 05:29:50  csoutheren
00078  * Added function to detect RFC 1918 addresses
00079  *
00080  * Revision 1.63  2004/02/23 17:27:19  ykiryanov
00081  * Added == and != operators for in_addr_t on BeOS as suggested by Craig Southeren to please compiler
00082  *
00083  * Revision 1.62  2003/09/17 05:41:58  csoutheren
00084  * Removed recursive includes
00085  *
00086  * Revision 1.61  2003/09/17 01:18:02  csoutheren
00087  * Removed recursive include file system and removed all references
00088  * to deprecated coooperative threading support
00089  *
00090  * Revision 1.60  2003/05/21 09:34:43  rjongbloed
00091  * Name lookup support for IPv6, thanks again Sébastien Josset
00092  *
00093  * Revision 1.59  2003/04/28 02:55:08  robertj
00094  * Added function to see at run time if IPv6 available, thanks Sebastien Josset
00095  *
00096  * Revision 1.58  2003/04/03 08:43:23  robertj
00097  * Added IPv4 mapping into IPv6, thanks Sebastien Josset
00098  *
00099  * Revision 1.57  2003/03/26 05:36:37  robertj
00100  * More IPv6 support (INADDR_ANY handling), thanks Sébastien Josset
00101  *
00102  * Revision 1.56  2003/02/03 11:23:32  robertj
00103  * Added function to get pointer to IP address data.
00104  *
00105  * Revision 1.55  2003/02/03 08:51:44  robertj
00106  * Fixed compatibility with old code so taking address of PIPSocket::Address
00107  *   gets address of 4 or 16 byte IP address.
00108  *
00109  * Revision 1.54  2002/12/02 03:57:18  robertj
00110  * More RTEMS support patches, thank you Vladimir Nesic.
00111  *
00112  * Revision 1.53  2002/11/02 00:32:21  robertj
00113  * Further fixes to VxWorks (Tornado) port, thanks Andreas Sikkema.
00114  *
00115  * Revision 1.52  2002/10/29 07:59:45  robertj
00116  * Changed in_addr6 to more universally used in6_addr.
00117  *
00118  * Revision 1.51  2002/10/08 14:31:43  robertj
00119  * Changed for IPv6 support, thanks Sébastien Josset.
00120  *
00121  * Revision 1.50  2002/10/08 12:41:51  robertj
00122  * Changed for IPv6 support, thanks Sébastien Josset.
00123  *
00124  * Revision 1.49  2002/09/16 01:08:59  robertj
00125  * Added #define so can select if #pragma interface/implementation is used on
00126  *   platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.
00127  *
00128  * Revision 1.48  2001/12/13 09:17:01  robertj
00129  * Added function to convert PString to IP address with error checking that can
00130  *   distinguish between 0.0.0.0 or 255.255.255.255 and illegal address.
00131  *
00132  * Revision 1.47  2001/09/14 08:00:38  robertj
00133  * Added new versions of Conenct() to allow binding to a specific local interface.
00134  *
00135  * Revision 1.46  2001/05/22 12:49:32  robertj
00136  * Did some seriously wierd rewrite of platform headers to eliminate the
00137  *   stupid GNU compiler warning about braces not matching.
00138  *
00139  * Revision 1.45  2001/03/05 04:18:27  robertj
00140  * Added net mask to interface info returned by GetInterfaceTable()
00141  *
00142  * Revision 1.44  2001/01/29 06:41:18  robertj
00143  * Added printing of entry of interface table.
00144  *
00145  * Revision 1.43  2000/06/26 11:17:19  robertj
00146  * Nucleus++ port (incomplete).
00147  *
00148  * Revision 1.42  1999/09/10 04:35:42  robertj
00149  * Added Windows version of PIPSocket::GetInterfaceTable() function.
00150  *
00151  * Revision 1.41  1999/09/10 02:31:42  craigs
00152  * Added interface table routines
00153  *
00154  * Revision 1.40  1999/08/30 02:21:03  robertj
00155  * Added ability to listen to specific interfaces for IP sockets.
00156  *
00157  * Revision 1.39  1999/08/08 09:04:01  robertj
00158  * Added operator>> for PIPSocket::Address class.
00159  *
00160  * Revision 1.38  1999/03/09 02:59:50  robertj
00161  * Changed comments to doc++ compatible documentation.
00162  *
00163  * Revision 1.37  1999/02/23 07:19:22  robertj
00164  * Added [] operator PIPSocket::Address to get the bytes out of an IP address.
00165  *
00166  * Revision 1.36  1999/02/16 08:12:00  robertj
00167  * MSVC 6.0 compatibility changes.
00168  *
00169  * Revision 1.35  1998/12/21 07:22:50  robertj
00170  * Virtualised functions for SOCKS support.
00171  *
00172  * Revision 1.34  1998/12/18 04:34:14  robertj
00173  * PPC Linux GNU C compatibility.
00174  *
00175  * Revision 1.33  1998/11/30 08:57:32  robertj
00176  * New directory structure
00177  *
00178  * Revision 1.32  1998/11/22 11:30:08  robertj
00179  * Check route table function to get a list
00180  *
00181  * Revision 1.31  1998/11/19 05:18:22  robertj
00182  * Added route table manipulation functions to PIPSocket class.
00183  *
00184  * Revision 1.30  1998/09/23 06:20:45  robertj
00185  * Added open source copyright license.
00186  *
00187  * Revision 1.29  1997/12/11 10:28:57  robertj
00188  * Added operators for IP address to DWORD conversions.
00189  *
00190  * Revision 1.28  1996/12/17 11:08:05  robertj
00191  * Added DNS name cache clear command.
00192  *
00193  * Revision 1.27  1996/11/30 12:10:00  robertj
00194  * Added Connect() variant so can set the local port number on link.
00195  *
00196  * Revision 1.26  1996/11/16 10:48:49  robertj
00197  * Fixed missing const in PIPSocket::Address stream output operator..
00198  *
00199  * Revision 1.25  1996/11/04 03:40:54  robertj
00200  * Moved address printer from inline to source.
00201  *
00202  * Revision 1.24  1996/09/14 13:09:21  robertj
00203  * Major upgrade:
00204  *   rearranged sockets to help support IPX.
00205  *   added indirect channel class and moved all protocols to descend from it,
00206  *   separating the protocol from the low level byte transport.
00207  *
00208  * Revision 1.23  1996/08/25 09:33:55  robertj
00209  * Added function to detect "local" host name.
00210  *
00211  * Revision 1.22  1996/03/26 00:51:13  robertj
00212  * Added GetLocalAddress() variant that returns port number as well.
00213  *
00214  * Revision 1.21  1996/03/16 04:41:30  robertj
00215  * Changed all the get host name and get host address functions to be more consistent.
00216  *
00217  * Revision 1.20  1996/03/03 07:37:56  robertj
00218  * Added Reusability clause to the Listen() function on sockets.
00219  *
00220  * Revision 1.19  1996/02/25 03:00:31  robertj
00221  * Added operator<< to PIPSocket::Address.
00222  * Moved some socket functions to platform dependent code.
00223  *
00224  * Revision 1.18  1996/02/08 12:11:19  robertj
00225  * Added GetPeerAddress that returns a port.
00226  *
00227  * Revision 1.17  1996/01/28 14:07:31  robertj
00228  * Changed service parameter to PString for ease of use in GetPortByService function
00229  * Fixed up comments.
00230  *
00231  * Revision 1.16  1995/12/23 03:44:59  robertj
00232  * Fixed unix portability issues.
00233  *
00234  * Revision 1.15  1995/12/10 11:32:11  robertj
00235  * Numerous fixes for sockets.
00236  *
00237  * Revision 1.14  1995/10/14 14:57:26  robertj
00238  * Added internet address to string conversion functionality.
00239  *
00240  * Revision 1.13  1995/07/02 01:18:19  robertj
00241  * Added static functions to get the current host name/address.
00242  *
00243  * Revision 1.12  1995/06/17 00:41:40  robertj
00244  * More logical design of port numbers and service names.
00245  *
00246  * Revision 1.11  1995/03/18 06:26:44  robertj
00247  * Changed IP address variable for GNU compatibility.
00248  *
00249  * Revision 1.10  1995/03/14  12:41:38  robertj
00250  * Updated documentation to use HTML codes.
00251  *
00252  * Revision 1.9  1995/03/12  04:38:41  robertj
00253  * Added more functionality.
00254  *
00255  * Revision 1.8  1995/01/02  12:28:24  robertj
00256  * Documentation.
00257  * Added more socket functions.
00258  *
00259  * Revision 1.7  1995/01/01  01:07:33  robertj
00260  * More implementation.
00261  *
00262  * Revision 1.6  1994/12/15  12:47:14  robertj
00263  * Documentation.
00264  *
00265  * Revision 1.5  1994/08/23  11:32:52  robertj
00266  * Oops
00267  *
00268  * Revision 1.4  1994/08/22  00:46:48  robertj
00269  * Added pragma fro GNU C++ compiler.
00270  *
00271  * Revision 1.3  1994/08/21  23:43:02  robertj
00272  * Spelt Berkeley correctly.
00273  *
00274  * Revision 1.2  1994/07/25  03:36:03  robertj
00275  * Added sockets to common, normalising to same comment standard.
00276  *
00277  */
00278 
00279 #ifndef _PIPSOCKET
00280 #define _PIPSOCKET
00281 
00282 #ifdef P_USE_PRAGMA
00283 #pragma interface
00284 #endif
00285 
00286 #include <ptlib/socket.h>
00287 
00295 class PIPSocket : public PSocket
00296 {
00297   PCLASSINFO(PIPSocket, PSocket);
00298   protected:
00299     /* Create a new Internet Protocol socket based on the port number
00300        specified.
00301      */
00302     PIPSocket();
00303 
00304   public:
00308     class Address : public PObject {
00309       public:
00310 
00313 
00314         Address();
00315 
00319         Address(const PString & dotNotation);
00320 
00322         Address(PINDEX len, const BYTE * bytes);
00323 
00325         Address(BYTE b1, BYTE b2, BYTE b3, BYTE b4);
00326 
00328         Address(DWORD dw);
00329 
00331         Address(const in_addr & addr);
00332 
00333 #if P_HAS_IPV6
00334 
00335         Address(const in6_addr & addr);
00336 
00339         Address(const int ai_family, const int ai_addrlen,struct sockaddr *ai_addr);
00340 #endif
00341 
00342 #ifdef __NUCLEUS_NET__
00343         Address(const struct id_struct & addr);
00344         Address & operator=(const struct id_struct & addr);
00345 #endif
00346 
00348         Address & operator=(const in_addr & addr);
00349 
00350 #if P_HAS_IPV6
00351 
00352         Address & operator=(const in6_addr & addr);
00353 #endif
00354 
00356         Address & operator=(const PString & dotNotation);
00357 
00359         Address & operator=(DWORD dw);
00361 
00363         Comparison Compare(const PObject & obj) const;
00364         bool operator==(const Address & addr) const { return Compare(addr) == EqualTo; }
00365         bool operator!=(const Address & addr) const { return Compare(addr) != EqualTo; }
00366 #if P_HAS_IPV6
00367         bool operator==(in6_addr & addr) const;
00368         bool operator!=(in6_addr & addr) const { return !operator==(addr); }
00369 #endif
00370         bool operator==(in_addr & addr) const;
00371         bool operator!=(in_addr & addr) const { return !operator==(addr); }
00372         bool operator==(DWORD dw) const;
00373         bool operator!=(DWORD dw) const   { return !operator==(dw); }
00374 #ifdef P_VXWORKS 
00375         bool operator==(long unsigned int u) const { return  operator==((DWORD)u); }
00376         bool operator!=(long unsigned int u) const { return !operator==((DWORD)u); }
00377 #endif
00378 #ifdef _WIN32
00379         bool operator==(unsigned u) const { return  operator==((DWORD)u); }
00380         bool operator!=(unsigned u) const { return !operator==((DWORD)u); }
00381 #endif
00382 #ifdef P_RTEMS
00383         bool operator==(u_long u) const { return  operator==((DWORD)u); }
00384         bool operator!=(u_long u) const { return !operator==((DWORD)u); }
00385 #endif
00386 #ifdef __BEOS__
00387         bool operator==(in_addr_t a) const { return  operator==((DWORD)a); }
00388         bool operator!=(in_addr_t a) const { return !operator==((DWORD)a); }
00389 #endif
00390         bool operator==(int i) const      { return  operator==((DWORD)i); }
00391         bool operator!=(int i) const      { return !operator==((DWORD)i); }
00392 
00395 #if P_HAS_IPV6
00396         bool operator*=(const Address & addr) const;
00397 #else
00398         bool operator*=(const Address & addr) const { return operator==(addr); }
00399 #endif
00400 
00402         PString AsString() const;
00403 
00405         BOOL FromString(
00406           const PString & str
00407         );
00408 
00410         operator PString() const;
00411 
00413         operator in_addr() const;
00414 
00415 #if P_HAS_IPV6
00416 
00417         operator in6_addr() const;
00418 #endif
00419 
00421         operator DWORD() const;
00422 
00424         BYTE Byte1() const;
00425 
00427         BYTE Byte2() const;
00428 
00430         BYTE Byte3() const;
00431 
00433         BYTE Byte4() const;
00434 
00436         BYTE operator[](PINDEX idx) const;
00437 
00439         PINDEX GetSize() const;
00440 
00442         const char * GetPointer() const { return (const char *)&v; }
00443 
00445         unsigned GetVersion() const { return version; }
00446 
00448         BOOL IsValid() const;
00449         BOOL IsAny() const;
00450 
00452         BOOL IsLoopback() const;
00453 
00455         BOOL IsBroadcast() const;
00456 
00457         // Check if the remote address is a private address.
00458         // For IPV4 this is specified RFC 1918 as the following ranges:
00459         //    10.0.0.0    - 10.255.255.255.255
00460         //    172.16.0.0  - 172.31.255.255
00461         //    192.168.0.0 - 192.168.255.255
00462         // For IPV6 this is specified as any address having "1111 1110 1” for the first nine bits
00463         BOOL IsRFC1918() const;
00464 
00465 #if P_HAS_IPV6
00466 
00467         BOOL IsV4Mapped() const;
00468 #endif
00469         
00470         static const Address & GetLoopback();
00471 #if P_HAS_IPV6
00472         static const Address & GetLoopback6();
00473         static const Address & GetAny6();
00474 #endif
00475         static const Address & GetBroadcast();
00476 
00477       protected:
00479         union {
00480           in_addr four;
00481 #if P_HAS_IPV6
00482           in6_addr six;
00483 #endif
00484         } v;
00485         unsigned version;
00486 
00488       friend ostream & operator<<(ostream & s, const Address & a);
00489 
00491       friend istream & operator>>(istream & s, Address & a);
00492     };
00493 
00494   // Overrides from class PChannel
00502     virtual PString GetName() const;
00503 
00504     // Set the default IP address familly.
00505     // Needed as lot of IPv6 stack are not able to receive IPv4 packets in IPv6 sockets
00506     // They are not RFC 2553, chapter 7.3, compliant.
00507     // As a concequence, when opening a socket to listen to port 1720 (for exemple) from any remot host
00508     // one must decide whether this an IPv4 or an IPv6 socket...
00509     static int GetDefaultIpAddressFamily();
00510     static void SetDefaultIpAddressFamily(int ipAdressFamily); // PF_INET, PF_INET6
00511     static void SetDefaultIpAddressFamilyV4(); // PF_INET
00512 #if P_HAS_IPV6
00513     static void SetDefaultIpAddressFamilyV6(); // PF_INET6
00514     static BOOL IsIpAddressFamilyV6Supported();
00515 #endif
00516     static PIPSocket::Address GetDefaultIpAny();
00517 
00518     // Open an IPv4 or IPv6 socket
00519     virtual BOOL OpenSocket(
00520       int ipAdressFamily=PF_INET
00521     ) = 0;
00522 
00523 
00524   // Overrides from class PSocket.
00536     virtual BOOL Connect(
00537       const PString & address   
00538     );
00539     virtual BOOL Connect(
00540       const Address & addr      
00541     );
00542     virtual BOOL Connect(
00543       WORD localPort,           
00544       const Address & addr      
00545     );
00546     virtual BOOL Connect(
00547       const Address & iface,    
00548       const Address & addr      
00549     );
00550     virtual BOOL Connect(
00551       const Address & iface,    
00552       WORD localPort,           
00553       const Address & addr      
00554     );
00555 
00571     virtual BOOL Listen(
00572       unsigned queueSize = 5,  
00573       WORD port = 0,           
00574       Reusability reuse = AddressIsExclusive 
00575     );
00576     virtual BOOL Listen(
00577       const Address & bind,     
00578       unsigned queueSize = 5,   
00579       WORD port = 0,            
00580       Reusability reuse = AddressIsExclusive 
00581     );
00582 
00583 
00584   // New functions for class
00592     static PString GetHostName();
00593     static PString GetHostName(
00594       const PString & hostname  
00595     );
00596     static PString GetHostName(
00597       const Address & addr    
00598     );
00599 
00606     static BOOL GetHostAddress(
00607       Address & addr    
00608     );
00609     static BOOL GetHostAddress(
00610       const PString & hostname,
00611       /* Name of host to get address for. This may be either a domain name or
00612          an IP number in "dot" format.
00613        */
00614       Address & addr    
00615     );
00616 
00624     static PStringArray GetHostAliases(
00625       const PString & hostname
00626       /* Name of host to get address for. This may be either a domain name or
00627          an IP number in "dot" format.
00628        */
00629     );
00630     static PStringArray GetHostAliases(
00631       const Address & addr    
00632       /* Name of host to get address for. This may be either a domain name or
00633          an IP number in "dot" format.
00634        */
00635     );
00636 
00644     static BOOL IsLocalHost(
00645       const PString & hostname
00646       /* Name of host to get address for. This may be either a domain name or
00647          an IP number in "dot" format.
00648        */
00649     );
00650 
00656     virtual BOOL GetLocalAddress(
00657       Address & addr    
00658     );
00659     virtual BOOL GetLocalAddress(
00660       Address & addr,    
00661       WORD & port        
00662     );
00663 
00670     virtual BOOL GetPeerAddress(
00671       Address & addr    
00672     );
00673     virtual BOOL GetPeerAddress(
00674       Address & addr,    
00675       WORD & port        
00676     );
00677 
00683     PString GetLocalHostName();
00684 
00690     PString GetPeerHostName();
00691 
00694     static void ClearNameCache();
00695 
00707     static BOOL GetGatewayAddress(
00708       Address & addr     
00709     );
00710 
00723     static PString GetGatewayInterface();
00724 
00728     class RouteEntry : public PObject
00729     {
00730       PCLASSINFO(RouteEntry, PObject);
00731       public:
00733         RouteEntry(const Address & addr) : network(addr) { }
00734 
00736         Address GetNetwork() const { return network; }
00737 
00739         Address GetNetMask() const { return net_mask; }
00740 
00742         Address GetDestination() const { return destination; }
00743 
00745         const PString & GetInterface() const { return interfaceName; }
00746 
00748         long GetMetric() const { return metric; }
00749 
00750       protected:
00751         Address network;
00752         Address net_mask;
00753         Address destination;
00754         PString interfaceName;
00755         long    metric;
00756 
00757       friend class PIPSocket;
00758     };
00759 
00760     PLIST(RouteTable, RouteEntry);
00761 
00767     static BOOL GetRouteTable(
00768       RouteTable & table      
00769     );
00770 
00771 
00775     class InterfaceEntry : public PObject
00776     {
00777       PCLASSINFO(InterfaceEntry, PObject)
00778 
00779       public:
00781         InterfaceEntry(
00782           const PString & _name,
00783           const Address & _addr,
00784           const Address & _mask,
00785           const PString & _macAddr
00786 #if P_HAS_IPV6
00787           , const PString & _ip6Addr = PString::Empty()
00788 #endif
00789         );
00790 
00792         virtual void PrintOn(
00793           ostream &strm   // Stream to print the object into.
00794         ) const;
00795 
00797         const PString & GetName() const { return name; }
00798 
00800         Address GetAddress() const { return ipAddr; }
00801 
00802         BOOL HasIP6Address() const
00803 #if ! P_HAS_IPV6
00804         { return FALSE;}
00805 #else
00806         { return !ip6Addr.IsEmpty();}
00807 
00809         Address GetIP6Address() const { return ip6Addr; }
00810 #endif
00811 
00813         Address GetNetMask() const { return netMask; }
00814 
00816         const PString & GetMACAddress() const { return macAddr; }
00817 
00818       protected:
00819         PString name;
00820         Address ipAddr;
00821         Address netMask;
00822         PString macAddr;
00823 #if P_HAS_IPV6
00824         PString ip6Addr;
00825 #endif
00826     };
00827 
00828     PLIST(InterfaceTable, InterfaceEntry);
00829 
00834     static BOOL GetInterfaceTable(
00835       InterfaceTable & table      
00836     );
00837 
00842     static BOOL GetNetworkInterface(PIPSocket::Address & addr);
00843 
00844 #if P_HAS_RECVMSG
00845 
00851     BOOL SetCaptureReceiveToAddress()
00852     { if (!SetOption(IP_PKTINFO, 1, SOL_IP)) return FALSE; catchReceiveToAddr = TRUE; return TRUE; }
00853 
00857     PIPSocket::Address GetLastReceiveToAddress() const
00858     { return lastReceiveToAddr; }
00859 
00860   protected:
00861     void SetLastReceiveAddr(void * addr, int addrLen)
00862     { if (addrLen == sizeof(in_addr)) lastReceiveToAddr = *(in_addr *)addr; }
00863 
00864     PIPSocket::Address lastReceiveToAddr;
00865 
00866 #else
00867 
00873     BOOL SetCaptureReceiveToAddress()
00874     { return FALSE; }
00875 
00879     PIPSocket::Address GetLastReceiveToAddress() const
00880     { return PIPSocket::Address(); }
00881 
00882 #endif
00883 
00884 // Include platform dependent part of class
00885 #ifdef _WIN32
00886 #include "msos/ptlib/ipsock.h"
00887 #else
00888 #include "unix/ptlib/ipsock.h"
00889 #endif
00890 };
00891 
00892 #endif
00893 
00894 
00895 // End Of File ///////////////////////////////////////////////////////////////

Generated on Mon Feb 21 20:43:09 2005 for PWLib by  doxygen 1.4.1