]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/ip/Address.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / ip / Address.h
index 3665de500807f769492f65adb8c1f4e0cc3e84eb..ae0fc373690d6921ad78466e6e57ce2f19e28298 100644 (file)
@@ -45,7 +45,7 @@
 #if HAVE_NETINET_IP_H
 #include <netinet/ip.h>
 #endif
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 #include <ws2tcpip.h>
 #endif
 #if HAVE_NETDB_H
@@ -75,7 +75,7 @@ class Address
 public:
     /** @name Constructors and Destructor */
     /*@{*/
-    Address();
+    Address() { SetEmpty(); }
     Address(const Address &);
 
     /**
@@ -94,8 +94,7 @@ public:
     Address(const struct hostent &);
     Address(const struct addrinfo &);
     Address(const char*);
-    /// Default destructor.
-    ~Address();
+    ~Address() {}
     /*@}*/
 
     /** @name Assignment Operators */
@@ -124,16 +123,14 @@ public:
     /* methods */
 
     /** Test whether content can be used as an IPv4 address
-     \retval true  if content was received as an IPv4 address
      \retval true  if content was received as an IPv4-Mapped address
      \retval false if content was received as a non-mapped IPv6 native address.
      */
     bool IsIPv4() const;
 
     /** Test whether content can be used as an IPv6 address.
-     \retval true  if --enable-ipv6 has been compiled.
-     \retval false if --disable-ipv6 has been compiled.
-     \retval false if --with-ipv6-split-stack has been compiled AND content is IPv4-mapped.
+     \retval true  if content is a non IPv4-mapped address.
+     \retval false if content is IPv4-mapped.
      */
     bool IsIPv6() const;
 
@@ -168,9 +165,9 @@ public:
     bool IsLocalhost() const;
 
     /** Test whether content is an IPv6 Site-Local address.
-     \retval true  if address begins with fe80::/10.
+     \retval true  if address begins with fd00::/8.
      \retval false if --disable-ipv6 has been compiled.
-     \retval false if address does not match fe80::/10
+     \retval false if address does not match fd00::/8
      */
     bool IsSiteLocal6() const;
 
@@ -187,7 +184,7 @@ public:
      \retval 0 Port is unset or an error occured.
      \retval n Port associated with this address in host native -endian.
      */
-    u_short GetPort() const;
+    unsigned short GetPort() const;
 
     /** Set the Port value for an address.
      *  Replaces any previously existing Port value.
@@ -195,7 +192,7 @@ public:
      \retval 0 Port is unset or an error occured.
      \retval n Port associated with this address in host native -endian.
      */
-    u_short SetPort(u_short port);
+    unsigned short SetPort(unsigned short port);
 
     /// Set object to contain the specific IP case ANY_ADDR (format-neutral).
     /// see IsAnyAddr() for more detail.
@@ -237,7 +234,6 @@ public:
      */
     bool ApplyMask(const unsigned int cidr, int mtype);
 
-
     /** Return the ASCII equivalent of the address
      *  Semantically equivalent to the IPv4 inet_ntoa()
      *  eg. 127.0.0.1 (IPv4) or ::1 (IPv6)
@@ -385,7 +381,6 @@ private:
     static const struct in6_addr v6_noaddr;
 };
 
-
 inline std::ostream &
 operator << (std::ostream &os, const Address &ipa)
 {