VMS Help
TCPIP Services, Programming Interfaces, Sockets API, inet_addr()

 *Conan The Librarian (sorry for the slow response - running on an old VAX)

    Converts internet addresses in text form into numeric (binary)
    internet addresses in dotted decimal format.
    Format
      #include  <in.h>
      #include  <inet.h>
      int inet_addr  ( char *cp );

  1 - Argument

 cp
    A pointer to a null-terminated character string containing an
    internet address in the standard internet dotted-decimal format.

  2 - Description

    This function returns an internet address in network byte order
    when given an ASCII (null-terminated) string that represents the
    address in the internet 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 systems has zero-
       extended bits in the high 32 bits of R0.

  3 - Return Values

    -1                 Indicates that cp does not point to a proper
                       internet address.
    x                  An internet address in network byte order.
  Close     HLB-list     TLB-list     Help  

[legal] [privacy] [GNU] [policy] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.