Converts between text and binary address formats.
Library (libc.a)
int inet_net_pton (af, src, dst, size) int af; const char *src; void *dst; size_t size;
This function converts a network address in ascii into the binary network address. The ascii representation can be CIDR-based (for example, 9.3.149.0/24) or class-based (for example, 9.3.149.0). The af parameter specifies the family of the address. The src parameter points to the string being passed in. The dst parameter points to a buffer where the function will store the resulting numeric address. The size parameter is the size (in bytes) of the buffer pointed to by the dst parameter.
If successful, the number of bits, either inputted classfully or specified with /CIDR, is returned. If unsuccessful, a -1 (negative one) is returned (check errno). ENOENT means it was not a valid network specification.
inet_net_ntop Subroutine, inet_ntop Subroutine, and inet_pton Subroutine.
Subroutines Overview in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.