[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Base Operating System and Extensions Technical Reference, 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 inadquate.

Related Information

The inet_net_pton subroutine, inet_ntop subroutine, inet_pton subroutine.

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


[ Previous | Next | Contents | Glossary | Home | Search ]