1NS(3) 386BSD Programmer's Manual NS(3) 2 3NNAAMMEE 4 nnss__aaddddrr, nnss__nnttooaa - Xerox NS(tm) address conversion routines 5 6SSYYNNOOPPSSIISS 7 ##iinncclluuddee <<ssyyss//ttyyppeess..hh>> 8 ##iinncclluuddee <<nneettnnss//nnss..hh>> 9 10 _s_t_r_u_c_t _n_s__a_d_d_r 11 nnss__aaddddrr(_c_h_a_r *_c_p) 12 13 _c_h_a_r * 14 nnss__nnttooaa(_s_t_r_u_c_t _n_s__a_d_d_r _n_s) 15 16DDEESSCCRRIIPPTTIIOONN 17 The routine nnss__aaddddrr() interprets character strings representing XNS 18 addresses, returning binary information suitable for use in system calls. 19 The routine nnss__nnttooaa() takes XNS addresses and returns ASCII strings 20 representing the address in a notation in common use in the Xerox 21 Development Environment: 22 23 <network number>.<host number>.<port number> 24 25 Trailing zero fields are suppressed, and each number is printed in 26 hexadecimal, in a format suitable for input to nnss__aaddddrr(). Any fields 27 lacking super-decimal digits will have a trailing `H' appended. 28 29 Unfortunately, no universal standard exists for representing XNS 30 addresses. An effort has been made to insure that nnss__aaddddrr() be 31 compatible with most formats in common use. It will first separate an 32 address into 1 to 3 fields using a single delimiter chosen from period 33 `.', colon `:' or pound-sign `#'. Each field is then examined for byte 34 separators (colon or period). If there are byte separators, each 35 subfield separated is taken to be a small hexadecimal number, and the 36 entirety is taken as a network-byte-ordered quantity to be zero extended 37 in the high-network-order bytes. Next, the field is inspected for 38 hyphens, in which case the field is assumed to be a number in decimal 39 notation with hyphens separating the millenia. Next, the field is 40 assumed to be a number: It is interpreted as hexadecimal if there is a 41 leading `0x' (as in C), a trailing `H' (as in Mesa), or there are any 42 super-decimal digits present. It is interpreted as octal is there is a 43 leading `0' and there are no super-octal digits. Otherwise, it is 44 converted as a decimal number. 45 46RREETTUURRNN VVAALLUUEESS 47 None. (See _B_U_G_S.) 48 49SSEEEE AALLSSOO 50 hosts(5), networks(5), 51 52HHIISSTTOORRYY 53 The nnss__aaddddrr() and nnss__ttooaa() functions appeared in 4.3BSD. 54 55BBUUGGSS 56 The string returned by nnss__nnttooaa() resides in a static memory area. The 57 function nnss__aaddddrr() should diagnose improperly formed input, and there 58 should be an unambiguous way to recognize this. 59 604.3 Berkeley Distribution April 19, 1991 1 61 62 63 64 65 66 67