LINK_ADDR(3) BSD Programmer's Manual LINK_ADDR(3) NNAAMMEE lliinnkk__aaddddrr, lliinnkk__nnttooaa - elementary address specification routines for link level access SSYYNNOOPPSSIISS ##iinncclluuddee <<ssyyss//ttyyppeess..hh>> ##iinncclluuddee <<ssyyss//ssoocckkeett..hh>> ##iinncclluuddee <<nneett//iiff__ddll..hh>> _v_o_i_d lliinnkk__aaddddrr(_c_o_n_s_t _c_h_a_r _*_a_d_d_r, _s_t_r_u_c_t _s_o_c_k_a_d_d_r___d_l _*_s_d_l); _c_h_a_r _* lliinnkk__nnttooaa(_c_o_n_s_t _s_t_r_u_c_t _s_o_c_k_a_d_d_r___d_l _*_s_d_l); DDEESSCCRRIIPPTTIIOONN The routine lliinnkk__aaddddrr() interprets character strings representing link- level addresses, returning binary information suitable for use in system calls. The routine lliinnkk__nnttooaa() takes a link-level address and returns an ASCII string representing some of the information present, including the link level address itself, and the interface name or number, if present. This facility is experimental and is still subject to change. For lliinnkk__aaddddrr(), the string _a_d_d_r may contain an optional network inter- face identifier of the form ``name unit-number'', suitable for the first argument to ifconfig(4), followed in all cases by a colon and an inter- face address in the form of groups of hexadecimal digits separated by pe- riods. Each group represents a byte of address; address bytes are filled left to right from low order bytes through high order bytes. Thus le0:8.0.9.13.d.30 represents an ethernet address to be transmitted on the first Lance ethernet interface. RREETTUURRNN VVAALLUUEESS lliinnkk__nnttooaa() always returns a null terminated string. lliinnkk__aaddddrr() has no return value. (See _B_U_G_S.) SSEEEE AALLSSOO iso(4), HHIISSTTOORRYY The lliinnkk__aaddddrr() and lliinnkk__nnttooaa() functions appeared in 4.3BSD-Reno. BBUUGGSS The returned values for link_ntoa reside in a static memory area. The function lliinnkk__aaddddrr() should diagnose improperly formed input, and there should be an unambiguous way to recognize this. If the _s_d_l___l_e_n field of the link socket address _s_d_l is 0, lliinnkk__nnttooaa() will not insert a colon before the interface address bytes. If this translated address is given to lliinnkk__aaddddrr() without inserting an initial colon, the latter will not interpret it correctly. 4.4BSD July 28, 1993 1