Struct IPv4

An IPv4 address

struct IPv4 ;

Constructors

NameDescription
this Construct an IPv4 address

Fields

NameTypeDescription
bytes ubyte[4]Address as array of bytes
inaddr core.sys.posix.arpa.inet.in_addrAddress as an in_addr

Properties

NameTypeDescription
hostOrder[get] uintReturn the address in host order
isValid[get] boolIs the address a valid one
netOrder[get] uintReturn the address in network order

Methods

NameDescription
isInSubnet Returns whether our IP and host are in the same network
isMask Return whether current address is a valid mask address
mask Return a mask corresponding to a network of 2^^bits addresses
maskBits Return how many bits in the current mask
opAssign Assignment
opBinary Return the intersection of the two addresses
toString Return a GC allocated string for the address (dot notation)