[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, 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 unsuccessful, 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 (inet_net_ntop Subroutine) subroutine, inet_ntop (inet_ntop Subroutine) subroutine, inet_pton (inet_pton Subroutine) subroutine.

Subroutines Overview in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]