Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
HTON.3
Upload User: jnzhq888
Upload Date: 2007-01-18
Package Size: 51694k
Code Size: 2k
Category:
OS Develop
Development Platform:
WINDOWS
- HTON(3) Minix Programmer's Manual HTON(3)
- NAME
- hton, htons, htonl, ntohs, ntohl - host to network byte order conversion
- SYNOPSIS
- #define _MINIX_SOURCE 1
- #include <stddef.h>
- #include <sys/types.h>
- #include <net/hton.h>
- u16_t htons(u16_t host_word)
- u32_t htonl(u32_t host_dword)
- u16_t ntohs(u16_t network_word)
- u32_t ntohl(u32_t network_dword)
- u16_t HTONS(u16_t host_word)
- u32_t HTONL(u32_t host_dword)
- u16_t NTOHS(u16_t network_word)
- u32_t NTOHL(u32_t network_dword)
- DESCRIPTION
- These macros convert 16-bit and 32-bit quantities to and from the network
- byte order used by the TCP/IP protocols. The function of the macros is
- encoded in their name. H means host byte order, n means network byte
- order, s means a 16-bit quantity and l means a 32-bit quantity. Thus
- htons converts a 16-bit quantity from host byte order to network byte
- order. The difference between the lower case and upper case variants is
- that the lower case variants evaluate the argument at most once and the
- upper case variants can be used for constant folding. That is,
- htonl(f(x))
- will call f(x) at most once and
- HTONS(0x10)
- will be equivalent to 0x10 on a big-endian machine and 0x1000 on a
- little-endian machine.
- SEE ALSO
- ip(4).
- AUTHOR
- Philip Homburg (philip@cs.vu.nl)
- 1