Lines Matching +full:out +full:- +full:of +full:- +full:reset

1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
5 * The Regents of the University of California. All rights reserved.
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * notice, this list of conditions and the following disclaimer in the
15 * 3. Neither the name of the University nor the names of its contributors
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42 #define RESET 3 macro
52 char *cp = sdl->sdl_data; in link_addr()
53 char *cplim = sdl->sdl_len + (char *)sdl; in link_addr()
56 bzero((char *)&sdl->sdl_family, sdl->sdl_len - 1); in link_addr()
57 sdl->sdl_family = AF_LINK; in link_addr()
61 new = *addr - '0'; in link_addr()
63 new = *addr - 'a' + 10; in link_addr()
65 new = *addr - 'A' + 10; in link_addr()
78 *cp++ = addr[-1]; in link_addr()
81 state = RESET; in link_addr()
82 sdl->sdl_nlen = cp - sdl->sdl_data; in link_addr()
87 case RESET | DIGIT: in link_addr()
96 state = RESET; in link_addr()
104 case RESET | END: in link_addr()
109 sdl->sdl_alen = cp - LLADDR(sdl); in link_addr()
110 new = cp - (char *)sdl; in link_addr()
112 sdl->sdl_len = new; in link_addr()
123 char *out; in link_ntoa() local
127 namelen = (sdl->sdl_nlen <= IFNAMSIZ) ? sdl->sdl_nlen : IFNAMSIZ; in link_ntoa()
129 out = obuf; in link_ntoa()
132 bcopy(sdl->sdl_data, out, namelen); in link_ntoa()
133 out += namelen; in link_ntoa()
134 rem -= namelen; in link_ntoa()
135 if (sdl->sdl_alen > 0) { in link_ntoa()
136 *out++ = ':'; in link_ntoa()
137 rem--; in link_ntoa()
141 in = (const u_char *)sdl->sdl_data + sdl->sdl_nlen; in link_ntoa()
142 inlim = in + sdl->sdl_alen; in link_ntoa()
145 if (in != (const u_char *)sdl->sdl_data + sdl->sdl_nlen) { in link_ntoa()
146 *out++ = '.'; in link_ntoa()
147 rem--; in link_ntoa()
153 *out++ = hexlist[i >> 4]; in link_ntoa()
154 *out++ = hexlist[i & 0xf]; in link_ntoa()
155 rem -= 2; in link_ntoa()
159 *out++ = hexlist[i]; in link_ntoa()
160 rem--; in link_ntoa()
163 *out = 0; in link_ntoa()