PQInetAddress

Struct holds PostgreSQL 'cidr' and 'inet' data types. Supports IPv4 and IPv6 with explicit mask designation (CIDR model).

Constructors

this
this(string addr, ubyte maskBits)

Parsing from string and network mask bits.

this
this(ubyte[16] adrr, ubyte maskBits, Family family)

Creating from raw data

Members

Functions

address
string address()

Returns address without mask

opCast
T opCast()

Casting to native D type, but mask is thrown away.

toBson
Bson toBson()

Serializing to BSON. Address and mask are holded separatly.

toString
string toString()

Converts to string like 'address/mast'

Static functions

fromBson
PQInetAddress fromBson(Bson bson)

Deserializing from BSON.

Variables

bits
ubyte bits;

Mask bits

family
Family family;

Address version

ipaddr
ubyte[16] ipaddr;

Address body, not all buffer is used for IPv4

Meta