1 #if defined(LIBC_SCCS) && !defined(lint)
2 static char rcsid[] = "$Id$";
3 #endif /* LIBC_SCCS and not lint */
6 #include <sys/socket.h>
7 #include <netinet/in.h>
8 #include <arpa/nameser.h>
12 #include "../conf/portability.h"
14 #if !defined(isxdigit) /* XXX - could be a function */
19 return ((c >= '0') && (c <= '9')) || ((c >= 'A') && (c <= 'F'));
27 return (c - (((c >= '0') && (c <= '9')) ? '0' : '7'));
31 inet_nsap_addr(ascii, binary, maxlen)
36 register u_char c, nib;
37 u_char *start = binary;
40 while ((c = *ascii++) != '\0' && len < maxlen) {
41 if (c == '.' || c == '+' || c == '/')
52 *binary++ = (nib << 4) | xtob(c);
67 inet_nsap_ntoa(binlen, binary, ascii)
69 register const u_char *binary;
74 static char tmpbuf[255*3];
87 for (i = 0; i < binlen; i++) {
89 *ascii++ = nib + (nib < 10 ? '0' : '7');
90 nib = *binary++ & 0x0f;
91 *ascii++ = nib + (nib < 10 ? '0' : '7');
92 if (((i % 2) == 0 && (i + 1) < binlen))