Skip to main content

Ntohs - Linuxコマンドを学ぶ

Anonim

htonl、htons、ntohl、ntohs - ホストとネットワークバイトオーダー間の値を変換する

シノプシス

#含める uint32_t htonl(uint32_t ホストロング ); uint16_t htons(uint16_t ホストショート ); uint32_t ntohl(uint32_t ネットロング ); uint16_t ntohs(uint16_t netshort );

説明

htonl() 関数は符号なし整数を変換します。 ホストロング ホストバイトオーダーからネットワークバイトオーダーまで。

htons() 関数は、符号なしの短い整数を変換します。 ホストショート ホストバイトオーダーからネットワークバイトオーダーまで。

ntohl() 関数は符号なし整数を変換します。 ネットロング ネットワークバイトオーダーからホストバイトオーダーまで。

ntohs() 関数は、符号なしの短い整数を変換します。 netshort ネットワークバイトオーダーからホストバイトオーダーまで。

i80x86では、ホストのバイトオーダは最下位バイトであり、インターネットで使用されるネットワークバイトオーダはMost Significant Byteです。

従う

BSD 4.3