1BYTEORDER(3) 386BSD Programmer's Manual BYTEORDER(3) 2 3NNAAMMEE 4 hhttoonnll, hhttoonnss, nnttoohhll, nnttoohhss - convert values between host and network byte 5 order 6 7SSYYNNOOPPSSIISS 8 ##iinncclluuddee <<ssyyss//ppaarraamm..hh>> 9 10 _u__l_o_n_g 11 hhttoonnll(_u__l_o_n_g _h_o_s_t_l_o_n_g) 12 13 _u__s_h_o_r_t 14 hhttoonnss(_u__s_h_o_r_t _h_o_s_t_s_h_o_r_t) 15 16 _u__l_o_n_g 17 nnttoohhll(_u__l_o_n_g _n_e_t_l_o_n_g) 18 19 _u__s_h_o_r_t 20 nnttoohhss(_u__s_h_o_r_t _n_e_t_s_h_o_r_t) 21 22DDEESSCCRRIIPPTTIIOONN 23 These routines convert 16 and 32 bit quantities between network byte 24 order 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 30SSEEEE AALLSSOO 31 gethostbyname(3), getservent(3) 32 33HHIISSTTOORRYY 34 The bbyytteeoorrddeerr functions appeared in 4.2BSD. 35 36BBUUGGSS 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 404.2 Berkeley Distribution April 19, 1991 1 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67