NS(4) BSD Programmer's Manual NS(4) NNAAMMEE nnss - Xerox Network Systems(tm) protocol family SSYYNNOOPPSSIISS ooppttiioonnss NNSS ooppttiioonnss NNSSIIPP ppsseeuuddoo--ddeevviiccee nnss DDEESSCCRRIIPPTTIIOONN The NS protocol family is a collection of protocols layered atop the _I_n_t_e_r_n_e_t _D_a_t_a_g_r_a_m _P_r_o_t_o_c_o_l (IDP) transport layer, and using the Xerox NS address formats. The NS family provides protocol support for the SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, and SOCK_RAW socket types; the SOCK_RAW interface is a debugging tool, allowing you to trace all packets entering, (or with toggling kernel variable, additionally leaving) the local host. AADDDDRREESSSSIINNGG NS addresses are 12 byte quantities, consisting of a 4 byte Network num- ber, a 6 byte Host number and a 2 byte port number, all stored in network standard format. (on the VAX these are word and byte reversed; on the Sun they are not reversed). The include file <_n_e_t_n_s_/_n_s_._h> defines the NS address as a structure containing unions (for quicker comparisons). Sockets in the Internet protocol family use the following addressing structure: struct sockaddr_ns { short sns_family; struct ns_addr sns_addr; char sns_zero[2]; }; where an _n_s___a_d_d_r is composed as follows: union ns_host { u_char c_host[6]; u_short s_host[3]; }; union ns_net { u_char c_net[4]; u_short s_net[2]; }; struct ns_addr { union ns_net x_net; union ns_host x_host; u_short x_port; }; Sockets may be created with an address of all zeroes to effect ``wildcard'' matching on incoming messages. The local port address spec- ified in a bind(2) call is restricted to be greater than NSPORT_RESERVED (=3000, in <_n_e_t_n_s_/_n_s_._h>) unless the creating process is running as the super-user, providing a space of protected port numbers. PPRROOTTOOCCOOLLSS The NS protocol family supported by the operating system is comprised of the Internet Datagram Protocol (IDP) idp(4), Error Protocol (available through IDP), and Sequenced Packet Protocol (SPP) spp(4). SPP is used to support the SOCK_STREAM and SOCK_SEQPACKET abstraction, while IDP is used to support the SOCK_DGRAM abstraction. The Error pro- tocol is responded to by the kernel to handle and report errors in proto- col processing; it is, however, only accessible to user programs through heroic actions. SSEEEE AALLSSOO intro(3), byteorder(3), gethostbyname(3), getnetent(3), getprotoent(3), getservent(3), ns(3), intro(4), spp(4), idp(4), nsip(4) _I_n_t_e_r_n_e_t _T_r_a_n_s_p_o_r_t _P_r_o_t_o_c_o_l_s, Xerox Corporation document XSIS, 028112. _A_n _A_d_v_a_n_c_e_d _4_._3 _B_S_D _I_n_t_e_r_p_r_o_c_e_s_s _C_o_m_m_u_n_i_c_a_t_i_o_n _T_u_t_o_r_i_a_l. HHIISSTTOORRYY The nnss protocol family appeared in 4.3BSD. 4.3 Berkeley Distribution June 5, 1993 2