| 1 | BYTEORDER(3) BSD Programmer's Manual BYTEORDER(3) |
| 2 | |
| 3 | N\bNA\bAM\bME\bE |
| 4 | h\bht\bto\bon\bnl\bl, h\bht\bto\bon\bns\bs, n\bnt\bto\boh\bhl\bl, n\bnt\bto\boh\bhs\bs - convert values between host and network byte |
| 5 | order |
| 6 | |
| 7 | S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS |
| 8 | #\b#i\bin\bnc\bcl\blu\bud\bde\be <\b<s\bsy\bys\bs/\b/p\bpa\bar\bra\bam\bm.\b.h\bh>\b> |
| 9 | |
| 10 | _\bu_\b__\bl_\bo_\bn_\bg |
| 11 | h\bht\bto\bon\bnl\bl(_\bu_\b__\bl_\bo_\bn_\bg _\bh_\bo_\bs_\bt_\bl_\bo_\bn_\bg); |
| 12 | |
| 13 | _\bu_\b__\bs_\bh_\bo_\br_\bt |
| 14 | h\bht\bto\bon\bns\bs(_\bu_\b__\bs_\bh_\bo_\br_\bt _\bh_\bo_\bs_\bt_\bs_\bh_\bo_\br_\bt); |
| 15 | |
| 16 | _\bu_\b__\bl_\bo_\bn_\bg |
| 17 | n\bnt\bto\boh\bhl\bl(_\bu_\b__\bl_\bo_\bn_\bg _\bn_\be_\bt_\bl_\bo_\bn_\bg); |
| 18 | |
| 19 | _\bu_\b__\bs_\bh_\bo_\br_\bt |
| 20 | n\bnt\bto\boh\bhs\bs(_\bu_\b__\bs_\bh_\bo_\br_\bt _\bn_\be_\bt_\bs_\bh_\bo_\br_\bt); |
| 21 | |
| 22 | D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN |
| 23 | These routines convert 16 and 32 bit quantities between network byte or- |
| 24 | der and host byte order. On machines which have a byte order which is |
| 25 | the same as the network order, routines are defined as null macros. |
| 26 | |
| 27 | These routines are most often used in conjunction with Internet addresses |
| 28 | and ports as returned by gethostbyname(3) and getservent(3). |
| 29 | |
| 30 | S\bSE\bEE\bE A\bAL\bLS\bSO\bO |
| 31 | gethostbyname(3), getservent(3) |
| 32 | |
| 33 | H\bHI\bIS\bST\bTO\bOR\bRY\bY |
| 34 | The b\bby\byt\bte\beo\bor\brd\bde\ber\br functions appeared in 4.2BSD. |
| 35 | |
| 36 | B\bBU\bUG\bGS\bS |
| 37 | On the VAX bytes are handled backwards from most everyone else in the |
| 38 | world. This is not expected to be fixed in the near future. |
| 39 | |
| 40 | 4.2 Berkeley Distribution June 4, 1993 1 |