GNU CommonC++
address.h
Go to the documentation of this file.
1 // Copyright (C) 1999-2005 Open Source Telecom Corporation.
2 // Copyright (C) 2006-2010 David Sugar, Tycho Softworks.
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 //
18 // As a special exception, you may use this file as part of a free software
19 // library without restriction. Specifically, if other files instantiate
20 // templates or use macros or inline functions from this file, or you compile
21 // this file and link it with other files to produce an executable, this
22 // file does not by itself cause the resulting executable to be covered by
23 // the GNU General Public License. This exception does not however
24 // invalidate any other reasons why the executable file might be covered by
25 // the GNU General Public License.
26 //
27 // This exception applies only to the code released under the name GNU
28 // Common C++. If you copy code from other releases into a copy of GNU
29 // Common C++, as the General Public License permits, the exception does
30 // not apply to the code that you add in this way. To avoid misleading
31 // anyone as to the status of such modified files, you must delete
32 // this exception notice from them.
33 //
34 // If you write modifications of your own for GNU Common C++, it is your choice
35 // whether to permit this exception to apply to your modifications.
36 // If you do not wish that, delete this exception notice.
37 //
38 
44 #ifndef CCXX_ADDRESS_H_
45 #define CCXX_ADDRESS_H_
46 
47 #ifndef CCXX_CONFIG_H_
48 #include <cc++/config.h>
49 #endif
50 
51 #ifndef CCXX_MISSING_H_
52 #include <cc++/missing.h>
53 #endif
54 
55 #ifndef CCXX_THREAD_H_
56 #include <cc++/thread.h>
57 #endif
58 
59 #ifndef CCXX_EXCEPTION_H_
60 #include <cc++/exception.h>
61 #endif
62 
63 #ifdef CCXX_NAMESPACES
64 namespace ost {
65 #endif
66 
67 // future definition of ipv4 specific classes, now defines
68 
69 #define INET_IPV4_ADDRESS_SIZE 16
70 #define CIDR_IPV4_ADDRESS_SIZE 32
71 #define INET_IPV6_ADDRESS_SIZE 40
72 #define CIDR_IPV6_ADDRESS_SIZE 45
73 
74 #define CIDR IPV4Cidr
75 #define InetAddress IPV4Address
76 #define InetHostAddress IPV4Host
77 #define InetMaskAddress IPV4Mask
78 #define InetMcastAddress IPV4Multicast
79 #define InetMcastAddressValidator IPV4MulticastValidator
80 #define InetAddrValidator IPV4Validator
81 #define BroadcastAddress IPV4Broadcast
82 
86 typedef unsigned short tpport_t;
87 
88 class __EXPORT IPV4Host;
89 
99 {
100 public:
105 
109  virtual ~IPV4Validator() {};
110 
115  virtual void
116  operator()(const in_addr address) const = 0;
117 };
118 
128 {
129 public:
134 
139 
144  void operator()(const in_addr address) const;
145 private:
146 #if __BYTE_ORDER == __BIG_ENDIAN
147  enum {
148  MCAST_VALID_MASK = 0xF0000000,
149  MCAST_VALID_VALUE = 0xE0000000
150  };
151 #else
152  enum {
153  MCAST_VALID_MASK = 0x000000F0,
154  MCAST_VALID_VALUE = 0x000000E0
155  };
156 #endif
157 };
158 
167 {
168 protected:
169  struct in_addr netmask, network;
170 
171  unsigned getMask(const char *cp) const;
172 public:
178  inline struct in_addr getNetwork(void) const
179  {return network;};
180 
186  inline struct in_addr getNetmask(void) const
187  {return netmask;};
188 
194  struct in_addr getBroadcast(void) const;
195 
202  void set(const char *cidr);
203 
209  IPV4Cidr(const char *cidr);
210 
215 
222 
229  bool isMember(const struct sockaddr *saddr) const;
230 
237  bool isMember(const struct in_addr &inaddr) const;
238 
239  inline bool operator==(const struct sockaddr *a) const
240  {return isMember(a);};
241 
242  inline bool operator==(const struct in_addr &a) const
243  {return isMember(a);};
244 };
245 
246 #ifdef CCXX_IPV6
247 
255 {
256 protected:
257  struct in6_addr netmask, network;
258 
259  unsigned getMask(const char *cp) const;
260 public:
266  inline struct in6_addr getNetwork(void) const
267  {return network;};
268 
274  inline struct in6_addr getNetmask(void) const
275  {return netmask;};
276 
282  struct in6_addr getBroadcast(void) const;
283 
290  void set(const char *cidr);
291 
297  IPV6Cidr(const char *cidr);
298 
303 
310 
317  bool isMember(const struct sockaddr *saddr) const;
318 
325  bool isMember(const struct in6_addr &inaddr) const;
326 
327  inline bool operator==(const struct sockaddr *sa) const
328  {return isMember(sa);};
329 
330  inline bool operator==(const struct in6_addr &a) const
331  {return isMember(a);};
332 };
333 
334 #endif
335 
351 {
352 private:
353  // The validator given to an IPV4Address object must not be a
354  // transient object, but that must exist at least until the
355  // last address object of its kind is deleted. This is an
356  // artifact to be able to do specific checks for derived
357  // classes inside constructors.
358  const InetAddrValidator *validator;
359 
360 protected:
361  struct in_addr * ipaddr;
362  size_t addr_count;
363  mutable char* hostname; // hostname for ipaddr[0]. Used by getHostname
364 #if defined(WIN32)
365  static MutexCounter counter;
366 #else
367  static Mutex mutex;
368 #endif
369 
376  bool setIPAddress(const char *host);
377 
384  void setAddress(const char *host);
385 
386 public:
394  IPV4Address(const InetAddrValidator *validator = NULL);
395 
404  IPV4Address(struct in_addr addr, const InetAddrValidator *validator = NULL);
405 
416  IPV4Address(const char *address, const InetAddrValidator *validator = NULL);
417 
422 
426  virtual ~IPV4Address();
427 
434  const char *getHostname(void) const;
435 
443  bool isInetAddress(void) const;
444 
452  struct in_addr getAddress(void) const;
453 
465  struct in_addr getAddress(size_t i) const;
466 
472  size_t getAddressCount() const { return addr_count; }
473 
474  IPV4Address &operator=(const char *str);
475  IPV4Address &operator=(struct in_addr addr);
477 
482  IPV4Address &operator=(unsigned long addr);
483 
484  inline IPV4Address &operator=(unsigned int addr)
485  {return *this = (unsigned long) addr; }
486 
487  inline bool operator!() const
488  {return !isInetAddress();};
489 
498  bool operator==(const IPV4Address &a) const;
499 
507  bool operator!=(const IPV4Address &a) const;
508 };
509 
523 {
524 public:
531  IPV4Mask(const char *mask);
532 
543  friend __EXPORT IPV4Host operator&(const IPV4Host &addr,
544  const IPV4Mask &mask);
545 
550  IPV4Address &operator=(unsigned long addr)
551  { return IPV4Address::operator =(addr); }
552 };
553 
562 {
563 private:
564  static IPV4Host _host_;
565 
566 public:
579  IPV4Host(const char *host = NULL);
580 
588  IPV4Host(struct in_addr addr);
589 
594  IPV4Address &operator=(unsigned long addr)
595  { return IPV4Address::operator =(addr); }
596 
601  IPV4Host &operator&=(const IPV4Mask &mask);
602 
603  friend class __EXPORT IPV4Mask;
604  friend __EXPORT IPV4Host operator&(const IPV4Host &addr,
605  const IPV4Mask &mask);
606 };
607 
613 {
614 public:
622  IPV4Broadcast(const char *net = "255.255.255.255");
623 };
624 
635 {
636 public:
642 
649  IPV4Multicast(const struct in_addr address);
650 
660  IPV4Multicast(const char *address);
661 
662 private:
670  static const IPV4MulticastValidator validator;
671 };
672 
673 extern __EXPORT std::ostream& operator<<(std::ostream &os, const IPV4Address &ia);
674 
675 inline struct in_addr getaddress(const IPV4Address &ia)
676  {return ia.getAddress();}
677 
678 
679 #ifdef CCXX_IPV6
680 
681 class __EXPORT IPV6Host;
682 
692 {
693 public:
698 
702  virtual ~IPV6Validator() {};
703 
708  virtual void operator()(const in6_addr address) const = 0;
709 };
710 
720 {
721 public:
726 
731 
736  void operator()(const in6_addr address) const;
737 };
738 
754 {
755 private:
756  // The validator given to an IPV4Address object must not be a
757  // transient object, but that must exist at least until the
758  // last address object of its kind is deleted. This is an
759  // artifact to be able to do specific checks for derived
760  // classes inside constructors.
761  const IPV6Validator *validator;
762 
763 protected:
764  struct in6_addr * ipaddr;
765  size_t addr_count;
766  mutable char* hostname; // hostname for ipaddr[0]. Used by getHostname
767 #if defined(WIN32)
768  static MutexCounter counter;
769 #else
770  static Mutex mutex;
771 #endif
772 
779  bool setIPAddress(const char *host);
780 
787  void setAddress(const char *host);
788 
789 public:
797  IPV6Address(const IPV6Validator *validator = NULL);
798 
807  IPV6Address(struct in6_addr addr, const IPV6Validator *validator = NULL);
808 
819  IPV6Address(const char *address, const IPV6Validator *validator = NULL);
820 
825 
829  virtual ~IPV6Address();
830 
837  const char *getHostname(void) const;
838 
846  bool isInetAddress(void) const;
847 
855  struct in6_addr getAddress(void) const;
856 
868  struct in6_addr getAddress(size_t i) const;
869 
875  size_t getAddressCount() const { return addr_count; }
876 
877  IPV6Address &operator=(const char *str);
878  IPV6Address &operator=(struct in6_addr addr);
880 
881  inline bool operator!() const
882  {return !isInetAddress();};
883 
892  bool operator==(const IPV6Address &a) const;
893 
901  bool operator!=(const IPV6Address &a) const;
902 };
903 
917 {
918 public:
925  IPV6Mask(const char *mask);
926 
937  friend __EXPORT IPV6Host operator&(const IPV6Host &addr,
938  const IPV6Mask &mask);
939 };
940 
949 {
950 public:
963  IPV6Host(const char *host = NULL);
964 
972  IPV6Host(struct in6_addr addr);
973 
978  IPV6Host &operator&=(const IPV6Mask &mask);
979 
980  friend class __EXPORT IPV6Mask;
981  friend __EXPORT IPV6Host operator&(const IPV6Host &addr, const IPV6Mask &mask);
982 };
983 
989 {
990 public:
998  IPV6Broadcast(const char *net = "255.255.255.255");
999 };
1000 
1011 {
1012 public:
1018 
1025  IPV6Multicast(const struct in6_addr address);
1026 
1036  IPV6Multicast(const char *address);
1037 
1038 private:
1046  static const IPV6MulticastValidator validator;
1047 };
1048 
1049 extern __EXPORT std::ostream& operator<<(std::ostream &os, const IPV6Address &ia);
1050 
1051 inline struct in6_addr getaddress(const IPV6Address &ia)
1052  {return ia.getAddress();}
1053 
1054 
1055 #endif
1056 
1057 #ifdef CCXX_NAMESPACES
1058 }
1059 #endif
1060 
1061 #endif
1062 
ost::IPV4Multicast
A specialization of IPV4Address that provides address validation for multicast addresses.
Definition: address.h:635
ost::IPV4Cidr::isMember
bool isMember(const struct sockaddr *saddr) const
See if a socket address is a member of this cidr's network.
ost::tpport_t
unsigned short tpport_t
Transport Protocol Ports.
Definition: address.h:86
ost::IPV4Address::mutex
static Mutex mutex
Definition: address.h:367
ost::IPV6Host::operator&=
IPV6Host & operator&=(const IPV6Mask &mask)
Mask the internet host address object with a network mask address.
ost::IPV4Cidr::IPV4Cidr
IPV4Cidr(IPV4Cidr &)
Construct a copy of a cidr.
ost::IPV4Address::setAddress
void setAddress(const char *host)
Used to specify a host name or numeric internet address.
ost::IPV4Mask
Internet addresses used specifically as masking addresses (such as " 255.255.255.0") are held in the ...
Definition: address.h:523
ost::IPV4Host
This object is used to hold the actual and valid internet address of a specific host machine that wil...
Definition: address.h:562
ost::IPV4Host::IPV4Host
IPV4Host(struct in_addr addr)
Convert a system socket binary address such as may be returned through the accept() call or getsockpe...
ost::IPV6Mask::operator&
friend __EXPORT IPV6Host operator&(const IPV6Host &addr, const IPV6Mask &mask)
Masks are usually used to coerce host addresses into a specific router or class domain.
ost::IPV4Address::IPV4Address
IPV4Address(const char *address, const IPV4Validator *validator=NULL)
Convert a null terminated ASCII host address string (example: "127.0.0.1") or host address name (exam...
ost::IPV4Multicast::IPV4Multicast
IPV4Multicast(const struct in_addr address)
Convert the system internet address data type (struct in_addr) into a Common C++ IPV4Multicast object...
ost::IPV4Address::isInetAddress
bool isInetAddress(void) const
May be used to verify if a given IPV4Address returned by another function contains a "valid" address,...
ost::IPV6Host::operator&
friend __EXPORT IPV6Host operator&(const IPV6Host &addr, const IPV6Mask &mask)
ost::IPV4Address::getHostname
const char * getHostname(void) const
Provide a string representation of the value (Internet Address) held in the IPV4Address object.
ost::IPV6Address::addr_count
size_t addr_count
Definition: address.h:765
ost::IPV4Cidr::operator==
bool operator==(const struct in_addr &a) const
Definition: address.h:242
ost::IPV6Address::IPV6Address
IPV6Address(const char *address, const IPV6Validator *validator=NULL)
Convert a null terminated ASCII host address string (example: "127.0.0.1") or host address name (exam...
ost::IPV6Multicast::IPV6Multicast
IPV6Multicast(const struct in6_addr address)
Convert the system internet address data type (struct in_addr) into a Common C++ IPV4Multicast object...
ost::IPV4Validator::operator()
virtual void operator()(const in_addr address) const =0
Pure virtual application operator.
ost::IPV6Mask
Internet addresses used specifically as masking addresses (such as " 255.255.255.0") are held in the ...
Definition: address.h:917
ost::IPV6Address::ipaddr
struct in6_addr * ipaddr
Definition: address.h:764
ost::IPV6Host
This object is used to hold the actual and valid internet address of a specific host machine that wil...
Definition: address.h:949
ost::IPV6MulticastValidator
Class for the function object that validates multicast addresses.
Definition: address.h:720
ost::IPV6Address::setIPAddress
bool setIPAddress(const char *host)
Sets the IP address from a string representation of the numeric address, ie "127.0....
ost::IPV4MulticastValidator
Class for the function object that validates multicast addresses.
Definition: address.h:128
ost::IPV4Cidr::set
void set(const char *cidr)
Set the cidr from a full or partial hostname, or from an address/mask, or a host/bits specification.
ost::IPV6Broadcast
The broadcast address object is used to store the broadcast address for a specific subnet.
Definition: address.h:989
ost::IPV4Cidr
The CIDR class is used to support routing tables and validate address policies.
Definition: address.h:167
ost::IPV6Host
class __EXPORT IPV6Host
Definition: address.h:681
ost::IPV6Address::isInetAddress
bool isInetAddress(void) const
May be used to verify if a given IPV6Address returned by another function contains a "valid" address,...
ost::IPV6Address::mutex
static Mutex mutex
Definition: address.h:770
ost::Mutex
The Mutex class is used to protect a section of code so that at any given time only a single thread c...
Definition: thread.h:187
ost::getaddress
struct in_addr getaddress(const IPV4Address &ia)
Definition: address.h:675
ost::IPV4Broadcast::IPV4Broadcast
IPV4Broadcast(const char *net="255.255.255.255")
Specify the physical broadcast address to use and create a new broadcast address object based on a nu...
ost::IPV6Cidr::set
void set(const char *cidr)
Set the cidr from a full or partial hostname, or from a host/bits specification.
ost::IPV6MulticastValidator::operator()
void operator()(const in6_addr address) const
Application operator.
ost::IPV4Address::~IPV4Address
virtual ~IPV4Address()
Destructor.
ost::IPV6Validator::IPV6Validator
IPV6Validator()
Constructor.
Definition: address.h:697
ost::IPV4Cidr::IPV4Cidr
IPV4Cidr()
Construct an empty cidr.
ost::IPV4MulticastValidator::~IPV4MulticastValidator
virtual ~IPV4MulticastValidator()
Keeps compilers happy.
Definition: address.h:138
ost::IPV6Cidr
The CIDR class is used to support routing tables and validate address policies.
Definition: address.h:255
ost::IPV6Cidr::operator==
bool operator==(const struct in6_addr &a) const
Definition: address.h:330
ost::IPV4Validator::~IPV4Validator
virtual ~IPV4Validator()
keeps compilers happy.
Definition: address.h:109
ost::IPV4Address::operator=
IPV4Address & operator=(struct in_addr addr)
ost::IPV4Address::operator==
bool operator==(const IPV4Address &a) const
Compare two internet addresses to see if they are equal (if they specify the physical address of the ...
ost::IPV6Address::getHostname
const char * getHostname(void) const
Provide a string representation of the value (Internet Address) held in the IPV6Address object.
ost::IPV4Address::IPV4Address
IPV4Address(const IPV4Address &rhs)
Copy constructor.
ost::MutexCounter
The Mutex Counter is a counter variable which can safely be incremented or decremented by multiple th...
Definition: thread.h:500
ost::IPV4Address::getAddressCount
size_t getAddressCount() const
Returns the number of internet addresses that an IPV4Address object contains.
Definition: address.h:472
ost::IPV6Cidr::IPV6Cidr
IPV6Cidr(const char *cidr)
Construct a new cidr from a string.
ost::IPV6Host::IPV6Host
IPV6Host(struct in6_addr addr)
Convert a system socket binary address such as may be returned through the accept() call or getsockpe...
ost::IPV6Multicast::IPV6Multicast
IPV6Multicast(const char *address)
Convert a null terminated ASCII multicast address string (example: "224.0.0.1") or multicast name str...
ost::IPV4Address::hostname
char * hostname
Definition: address.h:363
ost::IPV4Broadcast
The broadcast address object is used to store the broadcast address for a specific subnet.
Definition: address.h:613
ost::IPV6Address::operator=
IPV6Address & operator=(struct in6_addr addr)
ost::IPV6Validator
Classes derived from IPV6Address would require an specific validator to pass to the IPV6Address const...
Definition: address.h:692
ost::IPV4Host::IPV4Host
IPV4Host(const char *host=NULL)
Create a new host address for a specific internet host.
ost::IPV4Address::operator=
IPV4Address & operator=(unsigned int addr)
Definition: address.h:484
ost::IPV4MulticastValidator::operator()
void operator()(const in_addr address) const
Application operator.
ost::IPV4Address::setIPAddress
bool setIPAddress(const char *host)
Sets the IP address from a string representation of the numeric address, ie "127.0....
__EXPORT
#define __EXPORT
Definition: config.h:979
ost::IPV6Address
The network name and address objects are all derived from a common IPV6Address base class.
Definition: address.h:754
ost::IPV4Address
The network name and address objects are all derived from a common IPV4Address base class.
Definition: address.h:351
ost::IPV4Host::operator&
friend __EXPORT IPV4Host operator&(const IPV4Host &addr, const IPV4Mask &mask)
ost::IPV6Address::IPV6Address
IPV6Address(const IPV6Validator *validator=NULL)
Create an Internet Address object with an empty (0.0.0.0) address.
ost::IPV4Address::operator=
IPV4Address & operator=(unsigned long addr)
Allows assignment from the return of functions like inet_addr() or htonl()
ost::IPV4Address::operator!=
bool operator!=(const IPV4Address &a) const
Compare two internet addresses to see if they are not equal (if they each refer to unique and differe...
ost::IPV6Cidr::operator==
bool operator==(const struct sockaddr *sa) const
Definition: address.h:327
ost::IPV6Address::operator=
IPV6Address & operator=(const char *str)
ost::IPV6Address::getAddressCount
size_t getAddressCount() const
Returns the number of internet addresses that an IPV6Address object contains.
Definition: address.h:875
ost::IPV4Address::IPV4Address
IPV4Address(const IPV4Validator *validator=NULL)
Create an Internet Address object with an empty (0.0.0.0) address.
ost::IPV6Cidr::isMember
bool isMember(const struct in6_addr &inaddr) const
See if a low level address object is a member of this cidr's net.
ost::IPV4MulticastValidator::IPV4MulticastValidator
IPV4MulticastValidator()
Constructor.
Definition: address.h:133
ost::IPV6Address::operator=
IPV6Address & operator=(const IPV6Address &rhs)
ost::IPV6Cidr::isMember
bool isMember(const struct sockaddr *saddr) const
See if a socket address is a member of this cidr's network.
ost::IPV4Validator
Classes derived from IPV4Address would require an specific validator to pass to the IPV4Address const...
Definition: address.h:99
ost::IPV6Cidr::IPV6Cidr
IPV6Cidr()
Construct an empty cidr.
ost::IPV6Address::IPV6Address
IPV6Address(const IPV6Address &rhs)
Copy constructor.
ost::IPV4Multicast::IPV4Multicast
IPV4Multicast()
Create an Internet Multicast Address object with an empty (0.0.0.0) address.
ost::IPV4Address::operator=
IPV4Address & operator=(const IPV4Address &rhs)
ost::IPV6Address::setAddress
void setAddress(const char *host)
Used to specify a host name or numeric internet address.
ost::IPV4Mask::operator=
IPV4Address & operator=(unsigned long addr)
Allows assignment from the return of functions like inet_addr() or htonl()
Definition: address.h:550
ost::IPV4Mask::operator&
friend __EXPORT IPV4Host operator&(const IPV4Host &addr, const IPV4Mask &mask)
Masks are usually used to coerce host addresses into a specific router or class domain.
ost::IPV6MulticastValidator::IPV6MulticastValidator
IPV6MulticastValidator()
Constructor.
Definition: address.h:725
missing.h
substitute functions which may be missing in target platform libc.
ost::IPV4Host::operator=
IPV4Address & operator=(unsigned long addr)
Allows assignment from the return of functions like inet_addr() or htonl()
Definition: address.h:594
ost::IPV4Address::operator!
bool operator!() const
Definition: address.h:487
ost
Definition: address.h:64
ost::IPV4Cidr::operator==
bool operator==(const struct sockaddr *a) const
Definition: address.h:239
ost::IPV4Cidr::isMember
bool isMember(const struct in_addr &inaddr) const
See if a low level address object is a member of this cidr's net.
InetAddrValidator
#define InetAddrValidator
Definition: address.h:80
ost::IPV4Address::addr_count
size_t addr_count
Definition: address.h:362
ost::IPV6Address::IPV6Address
IPV6Address(struct in6_addr addr, const IPV6Validator *validator=NULL)
Convert the system internet address data type (struct in_addr) into a Common C++ IPV6Address object.
ost::IPV6Validator::~IPV6Validator
virtual ~IPV6Validator()
Keeps compilers happy.
Definition: address.h:702
ost::IPV4Address::ipaddr
struct in_addr * ipaddr
Definition: address.h:361
ost::IPV6Address::operator!
bool operator!() const
Definition: address.h:881
ost::IPV6Multicast
A specialization of IPV6Address that provides address validation for multicast addresses.
Definition: address.h:1011
config.h
ost::IPV4Validator::IPV4Validator
IPV4Validator()
Constructor.
Definition: address.h:104
ost::IPV6Address::hostname
char * hostname
Definition: address.h:766
exception.h
GNU Common C++ exception model base classes.
ost::IPV6Broadcast::IPV6Broadcast
IPV6Broadcast(const char *net="255.255.255.255")
Specify the physical broadcast address to use and create a new broadcast address object based on a nu...
ost::IPV6Multicast::IPV6Multicast
IPV6Multicast()
Create an Internet Multicast Address object with an empty (0.0.0.0) address.
ost::IPV4Host::operator&=
IPV4Host & operator&=(const IPV4Mask &mask)
Mask the internet host address object with a network mask address.
ost::IPV6Validator::operator()
virtual void operator()(const in6_addr address) const =0
Pure virtual application operator.
ost::operator<<
__EXPORT std::ostream & operator<<(std::ostream &os, const IPV4Address &ia)
ost::IPV4Multicast::IPV4Multicast
IPV4Multicast(const char *address)
Convert a null terminated ASCII multicast address string (example: "224.0.0.1") or multicast name str...
thread.h
Synchronization and threading services.
ost::IPV4Cidr::IPV4Cidr
IPV4Cidr(const char *cidr)
Construct a new cidr from a string.
ost::IPV6Mask::IPV6Mask
IPV6Mask(const char *mask)
Create the mask from a null terminated ASCII string such as "255.255.255.128".
ost::IPV6Host::IPV6Host
IPV6Host(const char *host=NULL)
Create a new host address for a specific internet host.
ost::IPV6Address::~IPV6Address
virtual ~IPV6Address()
Destructor.
ost::IPV4Address::IPV4Address
IPV4Address(struct in_addr addr, const IPV4Validator *validator=NULL)
Convert the system internet address data type (struct in_addr) into a Common C++ IPV4Address object.
ost::IPV6Address::operator!=
bool operator!=(const IPV6Address &a) const
Compare two internet addresses to see if they are not equal (if they each refer to unique and differe...
ost::IPV6MulticastValidator::~IPV6MulticastValidator
virtual ~IPV6MulticastValidator()
Keeps compilers happy...
Definition: address.h:730
ost::IPV6Cidr::IPV6Cidr
IPV6Cidr(IPV6Cidr &)
Construct a copy of a cidr.
ost::IPV4Address::operator=
IPV4Address & operator=(const char *str)
ost::IPV4Mask::IPV4Mask
IPV4Mask(const char *mask)
Create the mask from a null terminated ASCII string such as "255.255.255.128".
ost::IPV6Address::operator==
bool operator==(const IPV6Address &a) const
Compare two internet addresses to see if they are equal (if they specify the physical address of the ...