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

Technical Reference: Base Operating System and Extensions, Volume 1


inet_aton Subroutine

Purpose

Converts an ASCII string into an Internet address.

Library

Standard C Library (libc.a)

Syntax

#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>


int inet_aton ( CharString, InternetAddr)
char * CharString;
struct in_addr * InternetAddr;

Description

The inet_aton subroutine takes an ASCII string representing the Internet address in dot notation and converts it into an Internet address.

All applications containing the inet_aton subroutine must be compiled with _BSD set to a specific value. Acceptable values are 43 and 44. In addition, all socket applications must include the BSD libbsd.a library.

Parameters


CharString Contains the ASCII string to be converted to an Internet address.
InternetAddr Contains the Internet address that was converted from the ASCII string.

Return Values

Upon successful completion, the inet_aton subroutine returns 1 if CharString is a valid ASCII representation of an Internet address.

The inet_aton subroutine returns 0 if CharString is not a valid ASCII representation of an Internet address.

Files


/etc/hosts Contains host names.
/etc/networks Contains network names.

Related Information

The endhostent subroutine, endnetent subroutine, gethostbyaddr subroutine, gethostbyname subroutine, getnetbyaddr subroutine, getnetbyname subroutine, getnetent subroutine, inet_addr subroutine, inet_lnaof subroutine, inet_makeaddr subroutine, inet_network subroutine, inet_ntoa subroutine, sethostent subroutine, setnetent subroutine.

Sockets Overview and Network Address Translation in AIX 5L Version 5.1 Communications Programming Concepts.


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