* Copyright (c) 1989 Regents of the University of California.
* %sccs.include.redist.c%
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid
[] = "@(#)iso_addr.c 5.4 (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
register const char *addr
;
static struct iso_addr out_addr
;
register char *cp
= out_addr
.isoa_genaddr
;
char *cplim
= cp
+ sizeof(out_addr
.isoa_genaddr
);
register int byte
= 0, state
= VIRGIN
, new;
bzero((char *)&out_addr
, sizeof(out_addr
));
if ((*addr
>= '0') && (*addr
<= '9')) {
} else if ((*addr
>= 'a') && (*addr
<= 'f')) {
} else if ((*addr
>= 'A') && (*addr
<= 'F')) {
switch (state
/* | INPUT */) {
*cp
++ = byte
; /*FALLTHROUGH*/
state
= GOTONE
; byte
= new; continue;
state
= GOTTWO
; byte
= new + (byte
<< 4); continue;
state
= VIRGIN
; *cp
++ = byte
; byte
= 0; continue;
*cp
++ = byte
; /* FALLTHROUGH */
out_addr
.isoa_len
= cp
- out_addr
.isoa_genaddr
;
static char hexlist
[] = "0123456789abcdef";
const struct iso_addr
*isoa
;
register char *out
= obuf
;
register u_char
*in
= (u_char
*)isoa
->isoa_genaddr
;
u_char
*inlim
= in
+ isoa
->isoa_len
;
out
[1] = hexlist
[i
& 0xf];