(file) Return to HostAddress.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/HostAddress.h between version 1.1.2.3 and 1.5

version 1.1.2.3, 2007/06/18 09:10:40 version 1.5, 2008/12/16 18:56:00
Line 1 
Line 1 
 //%2007////////////////////////////////////////////////////////////////////////  //%LICENSE////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development  // Licensed to The Open Group (TOG) under one or more contributor license
 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.  // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;  // this work for additional information regarding copyright ownership.
 // IBM Corp.; EMC Corporation, The Open Group.  // Each contributor licenses this file to you under the OpenPegasus Open
 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;  // Source License; you may not use this file except in compliance with the
 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.  // License.
 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;  
 // EMC Corporation; VERITAS Software Corporation; The Open Group.  
 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;  
 // EMC Corporation; Symantec Corporation; The Open Group.  
 //  
 // Permission is hereby granted, free of charge, to any person obtaining a copy  
 // of this software and associated documentation files (the "Software"), to  
 // deal in the Software without restriction, including without limitation the  
 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or  
 // sell copies of the Software, and to permit persons to whom the Software is  
 // furnished to do so, subject to the following conditions:  
 //  
 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN  
 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED  
 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT  
 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR  
 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT  
 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN  
 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION  
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  
 // //
 //==============================================================================  // Permission is hereby granted, free of charge, to any person obtaining a
   // copy of this software and associated documentation files (the "Software"),
   // to deal in the Software without restriction, including without limitation
   // the rights to use, copy, modify, merge, publish, distribute, sublicense,
   // and/or sell copies of the Software, and to permit persons to whom the
   // Software is furnished to do so, subject to the following conditions:
   //
   // The above copyright notice and this permission notice shall be included
   // in all copies or substantial portions of the Software.
   //
   // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
   // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
   // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
   // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
   // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   //
   //////////////////////////////////////////////////////////////////////////
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 45 
Line 43 
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
   #ifdef INET_ADDRSTRLEN
   #define PEGASUS_INET_ADDRSTR_LEN INET_ADDRSTRLEN
   #else
 #define PEGASUS_INET_ADDRSTR_LEN 16 #define PEGASUS_INET_ADDRSTR_LEN 16
   #endif
   
   #ifdef INET6_ADDRSTRLEN
   #define PEGASUS_INET6_ADDRSTR_LEN INET6_ADDRSTRLEN
   #else
 #define PEGASUS_INET6_ADDRSTR_LEN 46 #define PEGASUS_INET6_ADDRSTR_LEN 46
   #endif
  
 #define PEGASUS_IPV4_LOOPBACK_ADDRESS "127.0.0.1"  #ifdef IN6ADDR_LOOPBACK_INIT
 #define PEGASUS_IPV6_LOOPBACK_ADDRESS  "::1"  #define PEGASUS_IPV6_LOOPBACK_INIT IN6ADDR_LOOPBACK_INIT
   #else
 #define PEGASUS_IPV6_LOOPBACK_INIT {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1} #define PEGASUS_IPV6_LOOPBACK_INIT {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}
   #endif
   
   
   #ifdef INADDR_LOOPBACK
   #define PEGASUS_IPV4_LOOPBACK_INIT INADDR_LOOPBACK
   #else
 #define PEGASUS_IPV4_LOOPBACK_INIT 0x7F000001 #define PEGASUS_IPV4_LOOPBACK_INIT 0x7F000001
   #endif
  
   #ifdef PEGASUS_ENABLE_IPV6
   #define PEGASUS_IN6_ADDR_SIZE (sizeof (struct in6_addr))
   #else
   #define PEGASUS_IN6_ADDR_SIZE 0x10
   #endif
  
 /** /**
     This class is used to store the host address. HostAddress can be Hostname or     This class is used to store the host address. HostAddress can be Hostname or
Line 84 
Line 104 
  
     /**     /**
         Constructor. addrStr can be HostName or IPv4Address or         Constructor. addrStr can be HostName or IPv4Address or
         IPv6Address.          IPv6Address (without brackets).
     */     */
     HostAddress(const String &addrStr);     HostAddress(const String &addrStr);
     HostAddress(const HostAddress &rhs);     HostAddress(const HostAddress &rhs);
Line 93 
Line 113 
     void setHostAddress(const String &addrStr);     void setHostAddress(const String &addrStr);
  
     /**     /**
         Returns true if the address is valid. If vaild it can be HostName          Returns true if the constructed HostAddress is valid.
         or IPv4Address or IPv6Address.          If valid it can be HostName or IPv4Address or IPv6Address.
           Check if HostAddress is valid by using isValid() method
           before making any calls on HostAddress object.
     */     */
     Boolean isValid();     Boolean isValid();
  
     /**     /**
         Verifies given ipv4Address and returns true if it is valid.          Verifies given IPv4Address and returns true if it is valid.
     */     */
     static Boolean isValidIPV4Address(const String &ipv4Address);     static Boolean isValidIPV4Address(const String &ipv4Address);
  
     /**     /**
         Verifies given ipv6Address and returns true if it is valid.          Verifies given IPv6Address (without brackets) and returns
           true if it is valid.
     */     */
     static Boolean isValidIPV6Address(const String &ipv6Address);     static Boolean isValidIPV6Address(const String &ipv6Address);
  
Line 149 
Line 172 
     static Boolean equal(int af, void *p1, void *p2);     static Boolean equal(int af, void *p1, void *p2);
  
     /**     /**
         Returns HostName or IPv4Address or IPv6Address. Removes port number          Returns HostName or IPv4Address or IPv6Address. This returns an empty
         from HostAddress if present. This returns empty string HostAddress is          String if HostAddress is not valid.
         not valid. Check if HostAddress is valid by using isValid() method          Check if HostAddress is valid by using isValid() method
         before making any calls on HostAddress object.         before making any calls on HostAddress object.
     */     */
     String getHost();     String getHost();


Legend:
Removed from v.1.1.2.3  
changed lines
  Added in v.1.5

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2