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

# ost\_IPV4Host(3)

This object is used to hold the actual and valid internet address of a specific host machine that will be accessed through a socket.

## NAME

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.

## SYNOPSIS

`#include <address.h>`

Inherits **ost::IPV4Address**.

### Public Member Functions

**IPV4Host** (const char \*host=NULL)\
 Create a new host address for a specific internet host.  **IPV4Host** (struct in\_addr addr)\
 Convert a system socket binary address such as may be returned through the accept() call or getsockpeer() into an internet host address object.  **IPV4Address** & **operator=** (unsigned long addr)\
 Allows assignment from the return of functions like inet\_addr() or htonl()  **IPV4Host** & **operator&=** (const **IPV4Mask** &mask)\
 Mask the internet host address object with a network mask address.

### Friends

class **\_\_EXPORT** **IPV4Mask**\
 **\_\_EXPORT** **IPV4Host** **operator&** (const **IPV4Host** &addr, const **IPV4Mask** &mask)\

### Additional Inherited Members

## Detailed Description

This object is used to hold the actual and valid internet address of a specific host machine that will be accessed through a socket.

**Author**

David Sugar dyfet@ostel.com

Address of a specific Internet host machine.

## Constructor & Destructor Documentation

### ost::IPV4Host::IPV4Host (const char \* host = `NULL`)

Create a new host address for a specific internet host. The internet host can be specified in a null terminated ASCII string and include either the physical host address or the DNS name of a host machine. Hence, an **IPV4Host** ('www.voxilla.org') can be directly declaired in this manner.

Defaults to the IP address that represents the interface matching 'gethostname()'.

**Parameters**

*host* dns or physical address of an Internet host.

### ost::IPV4Host::IPV4Host (struct in\_addr addr)

Convert a system socket binary address such as may be returned through the accept() call or getsockpeer() into an internet host address object.

**Parameters**

*addr* binary address of internet host.

## Member Function Documentation

### IPV4Host& ost::IPV4Host::operator&= (const IPV4Mask & mask)

Mask the internet host address object with a network mask address. This is commonly used to coerce an address by subnet.

### IPV4Address& ost::IPV4Host::operator= (unsigned long addr)` [inline]`

Allows assignment from the return of functions like inet\_addr() or htonl()

References ost::IPV4Address::operator=().

## Friends And Related Function Documentation

### friend class \_\_EXPORT IPV4Mask` [friend]`

### \_\_EXPORT IPV4Host operator& (const IPV4Host & addr, const IPV4Mask & mask)` [friend]`

## Author

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