⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hton.3

📁 操作系统设计与实现源码
💻 3
字号:
.TH HTON 3.SH NAMEhton, htons, htonl, ntohs, ntohl \- host to network byte order conversion.SH SYNOPSIS.ft B.nf#define _MINIX_SOURCE 1#include <stddef.h>#include <sys/types.h>#include <net/hton.h>u16_t htons(u16_t \fIhost_word\fP)u32_t htonl(u32_t \fIhost_dword\fP)u16_t ntohs(u16_t \fInetwork_word\fP)u32_t ntohl(u32_t \fInetwork_dword\fP)u16_t HTONS(u16_t \fIhost_word\fP)u32_t HTONL(u32_t \fIhost_dword\fP)u16_t NTOHS(u16_t \fInetwork_word\fP)u32_t NTOHL(u32_t \fInetwork_dword\fP).fi.ft R.SH DESCRIPTIONThese macros convert 16-bit and 32-bit quantities to and from the networkbyte order used by the TCP/IP protocols.The function of the macros is encoded in their name..B Hmeans host byte order,.B nmeans network byte order,.B smeans a 16-bit quantity and.B lmeans a 32-bit quantity.Thus.B htonsconverts a 16-bit quantity from host byte order to network byte order.The difference between the lower case and upper case variants is thatthe lower case variants evaluate the argument at most once and theupper case variants can be used for constant folding.That is,.PP.RShtonl(f(x)).RE.PPwill call f(x) at most once and.PP.RSHTONS(0x10).RE.PPwill be equivalent to 0x10 on a big-endian machine and 0x1000 on alittle-endian machine..SH "SEE ALSO".BR ip (4)..SH AUTHORPhilip Homburg (philip@cs.vu.nl)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -