Constructors

Synopses

Declared in <netaddress.h>

Construct an invalid subnet (empty, Match() always returns false).

CSubNet();

Construct a single‐host subnet.

explicit
CSubNet(CNetAddr const& addr);

Construct from a given network start and number of bits (CIDR mask).

CSubNet(
    CNetAddr const& addr,
    uint8_t mask);

Construct from a given network start and mask.

CSubNet(
    CNetAddr const& addr,
    CNetAddr const& mask);

Parameters

Name

Description

addr [in]

The sole address to be contained in the subnet, can also be non‐IPv[46].

mask [in]

CIDR mask, must be in [0, 32]for IPv4 addresses and in [0, 128]for IPv6 addresses. Otherwise an invalid subnet is created.

Created with MrDocs