Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ bytord(SLIB) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

gethostbyname(SLIB)

getservent(SLIB)


 byteorder(SLIB)                6 January 1993                byteorder(SLIB)


 Name

    byteorder, htons, htonl, ntohl, ntohs - convert values between host and
    network byte order

 Syntax


    #include  <sys/types.h>
    #include  <netinet/in.h>

    netlong = htonl(hostlong);
    unsigned long netlong, hostlong;

    netshort = htons(hostshort);
    ushort netshort, hostshort;

    hostlong = ntohl(netlong);
    unsigned long hostlong, netlong;

    hostshort = ntohs(netshort);
    ushort hostshort, netshort;


 Description

    These routines convert 16 and 32 bit quantities between network byte
    order and host byte order.

    These routines are most often used in conjunction with Internet addresses
    and ports as returned by gethostbyname(SLIB) and getservent(SLIB).

 See also

    gethostbyname(SLIB) and getservent(SLIB).


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026