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

# ost\_IPV6Cidr(3)

The CIDR class is used to support routing tables and validate address policies.

## NAME

ost::IPV6Cidr - The CIDR class is used to support routing tables and validate address policies.

## SYNOPSIS

`#include <address.h>`

### Public Member Functions

struct in6\_addr **getNetwork** (void) const\
 Get network address associated with this cidr.  struct in6\_addr **getNetmask** (void) const\
 Get network mask associated with this cidr.  struct in6\_addr **getBroadcast** (void) const\
 Compute the broadcast address associated with this cidr.  void **set** (const char \*cidr)\
 Set the cidr from a full or partial hostname, or from a host/bits specification.  **IPV6Cidr** (const char \*cidr)\
 Construct a new cidr from a string.  **IPV6Cidr** ()\
 Construct an empty cidr.  **IPV6Cidr** (**IPV6Cidr** &)\
 Construct a copy of a cidr.  bool **isMember** (const struct sockaddr \*saddr) const\
 See if a socket address is a member of this cidr's network.  bool **isMember** (const struct in6\_addr &inaddr) const\
 See if a low level address object is a member of this cidr's net.  bool **operator==** (const struct sockaddr \*sa) const\
 bool **operator==** (const struct in6\_addr &a) const\

### Protected Member Functions

unsigned **getMask** (const char \*cp) const\

### Protected Attributes

struct in6\_addr netmask **network**\

## Detailed Description

The CIDR class is used to support routing tables and validate address policies.

**Author**

David Sugar dyfet@gnutelephony.org

Classless Internet Domain Routing

## Constructor & Destructor Documentation

### ost::IPV6Cidr::IPV6Cidr (const char \* cidr)

Construct a new cidr from a string.

**Parameters**

*cidr* string to use.

### ost::IPV6Cidr::IPV6Cidr ()

Construct an empty cidr.

### ost::IPV6Cidr::IPV6Cidr (IPV6Cidr &)

Construct a copy of a cidr.

**Parameters**

*cidr* to copy from.

## Member Function Documentation

### struct in6\_addr ost::IPV6Cidr::getBroadcast (void) const

Compute the broadcast address associated with this cidr.

**Returns**

system binary coded network address.

### unsigned ost::IPV6Cidr::getMask (const char \* cp) const` [protected]`

### struct in6\_addr ost::IPV6Cidr::getNetmask (void) const` [inline]`

Get network mask associated with this cidr.

**Returns**

system binary coded network mask.

### struct in6\_addr ost::IPV6Cidr::getNetwork (void) const` [inline]`

Get network address associated with this cidr.

**Returns**

system binary coded address.

### bool ost::IPV6Cidr::isMember (const struct in6\_addr & inaddr) const

See if a low level address object is a member of this cidr's net.

**Parameters**

*inaddr* object to test.

**Returns**

true if member of cidr.

### bool ost::IPV6Cidr::isMember (const struct sockaddr \* saddr) const

See if a socket address is a member of this cidr's network.

**Parameters**

*saddr* pointer to test.

**Returns**

true if member of cidr.

### bool ost::IPV6Cidr::operator== (const struct in6\_addr & a) const` [inline]`

### bool ost::IPV6Cidr::operator== (const struct sockaddr \* sa) const` [inline]`

### void ost::IPV6Cidr::set (const char \* cidr)

Set the cidr from a full or partial hostname, or from a host/bits specification.

**Parameters**

*cidr* string to use.

## Member Data Documentation

### struct in6\_addr netmask ost::IPV6Cidr::network` [protected]`

## Author

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