---
name: "address.h"
section: "3"
platform: "linux"
package: "libcommoncpp2-doc"
version: "1.8.1-10"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/address.h"
---

# address.h(3)

Network addresses and sockets related classes.

## NAME

address.h - Network addresses and sockets related classes.

## SYNOPSIS

`#include <cc++/config.h>`\
 `#include <cc++/missing.h>`\
 `#include <cc++/thread.h>`\
 `#include <cc++/exception.h>`\

### Classes

class **ost::IPV4Validator**\
 Classes derived from **IPV4Address** would require an specific validator to pass to the **IPV4Address** constructor.  class **ost::IPV4MulticastValidator**\
 Class for the function object that validates multicast addresses.  class **ost::IPV4Cidr**\
 The CIDR class is used to support routing tables and validate address policies.  class **ost::IPV6Cidr**\
 The CIDR class is used to support routing tables and validate address policies.  class **ost::IPV4Address**\
 The network name and address objects are all derived from a common **IPV4Address** base class.  class **ost::IPV4Mask**\
 Internet addresses used specifically as masking addresses (such as ' 255.255.255.0') are held in the **IPV4Mask** derived object. " class **ost::IPV4Host**\
 This object is used to hold the actual and valid internet address of a specific host machine that will be accessed through a socket.  class **ost::IPV4Broadcast**\
 The broadcast address object is used to store the broadcast address for a specific subnet.  class **ost::IPV4Multicast**\
 A specialization of **IPV4Address** that provides address validation for multicast addresses.  class **ost::IPV6Validator**\
 Classes derived from **IPV6Address** would require an specific validator to pass to the **IPV6Address** constructor.  class **ost::IPV6MulticastValidator**\
 Class for the function object that validates multicast addresses.  class **ost::IPV6Address**\
 The network name and address objects are all derived from a common **IPV6Address** base class.  class **ost::IPV6Mask**\
 Internet addresses used specifically as masking addresses (such as ' 255.255.255.0') are held in the **IPV6Mask** derived object. " class **ost::IPV6Host**\
 This object is used to hold the actual and valid internet address of a specific host machine that will be accessed through a socket.  class **ost::IPV6Broadcast**\
 The broadcast address object is used to store the broadcast address for a specific subnet.  class **ost::IPV6Multicast**\
 A specialization of **IPV6Address** that provides address validation for multicast addresses.

### Namespaces

 **ost**\

### Macros

\#define **INET\_IPV4\_ADDRESS\_SIZE**   16\
 \#define **CIDR\_IPV4\_ADDRESS\_SIZE**   32\
 \#define **INET\_IPV6\_ADDRESS\_SIZE**   40\
 \#define **CIDR\_IPV6\_ADDRESS\_SIZE**   45\
 \#define **CIDR**   IPV4Cidr\
 \#define **InetAddress**   IPV4Address\
 \#define **InetHostAddress**   IPV4Host\
 \#define **InetMaskAddress**   IPV4Mask\
 \#define **InetMcastAddress**   IPV4Multicast\
 \#define **InetMcastAddressValidator**   IPV4MulticastValidator\
 \#define **InetAddrValidator**   IPV4Validator\
 \#define **BroadcastAddress**   IPV4Broadcast\

### Typedefs

typedef unsigned short **ost::tpport\_t**\
 Transport Protocol Ports.

### Functions

**\_\_EXPORT** std::ostream & **ost::operator\<\<** (std::ostream &os, const IPV4Address &ia)\
 struct in\_addr **ost::getaddress** (const IPV4Address &ia)\
 **\_\_EXPORT** std::ostream & **ost::operator\<\<** (std::ostream &os, const IPV6Address &ia)\
 struct in6\_addr **ost::getaddress** (const IPV6Address &ia)\

### Variables

class **\_\_EXPORT** **ost::IPV4Host**\
 class **\_\_EXPORT** **ost::IPV6Host**\

## Detailed Description

Network addresses and sockets related classes.

## Macro Definition Documentation

### #define BroadcastAddress IPV4Broadcast

**Examples** **tcpthread.cpp**.

### #define CIDR IPV4Cidr

### #define CIDR\_IPV4\_ADDRESS\_SIZE 32

### #define CIDR\_IPV6\_ADDRESS\_SIZE 45

### #define INET\_IPV4\_ADDRESS\_SIZE 16

### #define INET\_IPV6\_ADDRESS\_SIZE 40

### #define InetAddress IPV4Address

**Examples** **tcp.cpp**, **tcpstr1.cpp**, and **tcpthread.cpp**.

### #define InetAddrValidator IPV4Validator

### #define InetHostAddress IPV4Host

**Examples** **SampleSocketPort.cpp**, **tcp.cpp**, **tcpservice.cpp**, and **tcpthread.cpp**.

### #define InetMaskAddress IPV4Mask

### #define InetMcastAddress IPV4Multicast

### #define InetMcastAddressValidator IPV4MulticastValidator

## Author

Generated automatically by Doxygen for GNU CommonC++ from the source code.
