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

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

    Converts short integers from host byte order to network byte
    order.
    Format
      #include  <in.h>
      unsigned short int htons  ( unsigned short int hostshort );

  1 - Argument

 hostshort
    A short integer in host byte order (OpenVMS systems). All
    short integers on OpenVMS systems are in host byte order unless
    otherwise specified.

  2 - Description

    This function converts 16-bit unsigned integers from host byte
    order to network byte order.
    Network byte order is the format in which data bytes are expected
    to be transmitted through a network. All hosts on a network
    should send data in network byte order. Not all hosts have an
    internal data representation format that is identical to the
    network byte order. The host byte order is the format in which
    bytes are ordered internally on a specific host. The host byte
    order on OpenVMS systems differs from the network byte order.
    This function is most often used with ports as returned by
    getservent(). Network byte order places the byte with the most
    significant bits at lower addresses, whereas OpenVMS systems
    place the most significant bits at the highest address.
                                   NOTE
       The 64-bit return from OpenVMS Alpha systems has zero-
       extended bits in the high 32 bits of R0.

  3 - Return Value

    x                  A short integer in network byte order.
                       Integers in network byte order cannot be used
                       for arithmetic computation on OpenVMS systems.
  Close     HLB-list     TLB-list     Help  

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