man inet_cidr () - inet_cidr_ntop ,
NAME
SYNOPSIS
DESCRIPTION
These routines are used for converting addresses to and from network and presentation forms with CIDR (Classless Inter-Domain Routing) representation, embedded net mask.
130.155.16.1/20
inet_cidr_ntop converts an address from network to presentation format.
describes the type of address that is being passed in Currently only AF_INET is supported.
is an address in network byte order, its length is determined from
specifies the number of bits in the netmask unless it is -1 in which case the CIDR representation is omitted.
is a caller supplied buffer of at least bytes.
inet_cidr_ntop returns on success or NULL. Check errno for reason.
inet_cidr_pton converts and address from presentation format, with optional CIDR reperesentation, to network format. The resulting address is zero filled if there were insufficint bits in
describes the type of address that is being passed in via and determines the size of
is an address in presentation format.
returns the number of bits in the netmask or -1 if a CIDR representation was not supplied.
inet_cidr_pton returns 0 on succces or -1 on error. Check errno for reason. ENOENT indicates an invalid netmask.