[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Base Operating System and Extensions Technical Reference, Volume 1

inet_net_pton Subroutine

Purpose

Converts between text and binary address formats.

Library

Library (libc.a)

Syntax

char *inet_net_ntop
int af;
const char *src;
void *dst;
size_t size;

Description

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 argument, af, specifies the family of the address. The argument, src, points the string being passed in. The argument, dst, points to a buffer where the function will store the resulting numeric address.

Return Values

If successful, 1 (one) is returned. If unseccessful, 0 (zero) is returned if the input is not a valid IPv4 string; or a -1 (negative one) with errno set to EAFNOSUPPORT if the af argument is unknown.

Related Information

The inet_net_ntop subroutine, inet_ntop subroutine, inet_pton subroutine.

Subroutines Overview in AIX Version 4 General Programming Concepts: Writing and Debugging Programs.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]