VMS Help  —  TCPIP Services, Programming Interfaces, Socket API Functions, inet_aton()
    Converts an IP address in the standard dotted-decimal format
    to its numeric binary form, in network byte order. Replaces the
    inet_addr() function.
    Format
      #include  <inet.h>
      int inet_aton  ( const char *cp, struct in_addr *in);

1  –  Argument

 cp
    A pointer to a null-terminated character string containing an
    internet address in the standard internet dotted-decimal format.
 in
    A pointer to a buffer that is to contain the numeric internet
    address in network byte order.

2  –  Description

    This function returns a numeric internet address in network byte
    order that represents the internet address supplied in standard
    dotted-decimal format as its argument.
    Internet addresses specified with the dotted-decimal format take
    one of the following forms:
    a.b.c.d
    a.b.c
    a.b
    a
    When four parts are specified, each is interpreted as a byte
    of data and assigned, from left to right, to the 4 bytes of an
    internet address. Note that when an internet address is viewed as
    a 32-bit integer quantity on an OpenVMS system, the bytes appear
    in binary as d.c.b.a. That is, OpenVMS bytes are ordered from
    least significant to most significant.
    When only one part is given, the value is stored directly in the
    network address without any byte rearrangement.
    All numbers supplied as parts in a dotted-decimal address can be
    decimal, octal, or hexadecimal, as specified in the C language.
    (That is, a leading 0x or 0X implies hexadecimal; a leading 0
    implies octal; otherwise, the number is interpreted as decimal.)
                                   NOTE
       The 64-bit return from OpenVMS Alpha and I64 systems has
       zero-extended bits in the high 32 bits of R0.

3  –  Return Value

    1                  Indicates success.
    0                  Indicates failure.
Close Help