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

Technical Reference: Base Operating System and Extensions, Volume 1


inet_net_ntop Subroutine

Purpose

Converts between binary and text address formats.

Library

Library (libc.a)

Syntax

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

Description

This function converts a network address and the number of bits in the network part of the address into the CIDR format ascii text (for example, 9.3.149.0/24). The argument, af, specifies the family of the address. The argument, src, points to a buffer holding an IPv4 address if the af argument is AF_INET. The argument, dst, points to a buffer where the function stores the resulting text string.

Return Values

If successful, a pointer to a buffer containing the text string is returned. If unsuccessful, NULL is returned. Upon failure, errno is set to EAFNOSUPPORT if the af argument is invalid or ENOSPC if the size of the result buffer is inadequate.

Related Information

The inet_net_pton (inet_net_pton 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 ]