diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libc/net/gethostnamadr.c | 15 | ||||
| -rw-r--r-- | src/lib/libc/net/htons.c | 4 | ||||
| -rw-r--r-- | src/lib/libc/net/ns_ntoa.c | 3 | ||||
| -rw-r--r-- | src/lib/libc/net/ntohs.c | 4 |
4 files changed, 17 insertions, 9 deletions
diff --git a/src/lib/libc/net/gethostnamadr.c b/src/lib/libc/net/gethostnamadr.c index ec3f14a900..6d8072bd79 100644 --- a/src/lib/libc/net/gethostnamadr.c +++ b/src/lib/libc/net/gethostnamadr.c | |||
| @@ -144,7 +144,7 @@ getanswer(answer, anslen, iquery) | |||
| 144 | if (qdcount) { | 144 | if (qdcount) { |
| 145 | if (iquery) { | 145 | if (iquery) { |
| 146 | if ((n = dn_expand((u_char *)answer->buf, | 146 | if ((n = dn_expand((u_char *)answer->buf, |
| 147 | (u_char *)eom, (u_char *)cp, (u_char *)bp, | 147 | (u_char *)eom, (u_char *)cp, bp, |
| 148 | buflen)) < 0) { | 148 | buflen)) < 0) { |
| 149 | h_errno = NO_RECOVERY; | 149 | h_errno = NO_RECOVERY; |
| 150 | return ((struct hostent *) NULL); | 150 | return ((struct hostent *) NULL); |
| @@ -174,7 +174,7 @@ getanswer(answer, anslen, iquery) | |||
| 174 | haveanswer = 0; | 174 | haveanswer = 0; |
| 175 | while (--ancount >= 0 && cp < eom) { | 175 | while (--ancount >= 0 && cp < eom) { |
| 176 | if ((n = dn_expand((u_char *)answer->buf, (u_char *)eom, | 176 | if ((n = dn_expand((u_char *)answer->buf, (u_char *)eom, |
| 177 | (u_char *)cp, (u_char *)bp, buflen)) < 0) | 177 | (u_char *)cp, bp, buflen)) < 0) |
| 178 | break; | 178 | break; |
| 179 | cp += n; | 179 | cp += n; |
| 180 | type = _getshort(cp); | 180 | type = _getshort(cp); |
| @@ -195,7 +195,7 @@ getanswer(answer, anslen, iquery) | |||
| 195 | } | 195 | } |
| 196 | if (iquery && type == T_PTR) { | 196 | if (iquery && type == T_PTR) { |
| 197 | if ((n = dn_expand((u_char *)answer->buf, | 197 | if ((n = dn_expand((u_char *)answer->buf, |
| 198 | (u_char *)eom, (u_char *)cp, (u_char *)bp, | 198 | (u_char *)eom, (u_char *)cp, bp, |
| 199 | buflen)) < 0) | 199 | buflen)) < 0) |
| 200 | break; | 200 | break; |
| 201 | cp += n; | 201 | cp += n; |
| @@ -368,11 +368,11 @@ gethostbyaddr(addr, len, type) | |||
| 368 | switch (lookups[i]) { | 368 | switch (lookups[i]) { |
| 369 | #ifdef YP | 369 | #ifdef YP |
| 370 | case 'y': | 370 | case 'y': |
| 371 | hp = _yp_gethtbyaddr(addr, len, type); | 371 | hp = _yp_gethtbyaddr(addr); |
| 372 | break; | 372 | break; |
| 373 | #endif | 373 | #endif |
| 374 | case 'b': | 374 | case 'b': |
| 375 | n = res_query(qbuf, C_IN, T_PTR, (char *)&buf, sizeof(buf)); | 375 | n = res_query(qbuf, C_IN, T_PTR, (u_char *)&buf, sizeof(buf)); |
| 376 | if (n < 0) { | 376 | if (n < 0) { |
| 377 | #ifdef DEBUG | 377 | #ifdef DEBUG |
| 378 | if (_res.options & RES_DEBUG) | 378 | if (_res.options & RES_DEBUG) |
| @@ -469,7 +469,7 @@ again: | |||
| 469 | 469 | ||
| 470 | struct hostent * | 470 | struct hostent * |
| 471 | _gethtbyname(name) | 471 | _gethtbyname(name) |
| 472 | char *name; | 472 | const char *name; |
| 473 | { | 473 | { |
| 474 | register struct hostent *p; | 474 | register struct hostent *p; |
| 475 | register char **cp; | 475 | register char **cp; |
| @@ -598,9 +598,8 @@ done: | |||
| 598 | } | 598 | } |
| 599 | 599 | ||
| 600 | struct hostent * | 600 | struct hostent * |
| 601 | _yp_gethtbyaddr(addr, len, type) | 601 | _yp_gethtbyaddr(addr) |
| 602 | const char *addr; | 602 | const char *addr; |
| 603 | int len, type; | ||
| 604 | { | 603 | { |
| 605 | struct hostent *hp = (struct hostent *)NULL; | 604 | struct hostent *hp = (struct hostent *)NULL; |
| 606 | static char *__ypcurrent; | 605 | static char *__ypcurrent; |
diff --git a/src/lib/libc/net/htons.c b/src/lib/libc/net/htons.c index b2500a51d1..9b1de6ccfc 100644 --- a/src/lib/libc/net/htons.c +++ b/src/lib/libc/net/htons.c | |||
| @@ -15,8 +15,12 @@ static char *rcsid = "$NetBSD: htons.c,v 1.5 1995/04/28 23:25:19 jtc Exp $"; | |||
| 15 | #undef htons | 15 | #undef htons |
| 16 | 16 | ||
| 17 | unsigned short | 17 | unsigned short |
| 18 | #if __STDC__ | ||
| 19 | htons(unsigned short x) | ||
| 20 | #else | ||
| 18 | htons(x) | 21 | htons(x) |
| 19 | unsigned short x; | 22 | unsigned short x; |
| 23 | #endif | ||
| 20 | { | 24 | { |
| 21 | #if BYTE_ORDER == LITTLE_ENDIAN | 25 | #if BYTE_ORDER == LITTLE_ENDIAN |
| 22 | u_char *s = (u_char *) &x; | 26 | u_char *s = (u_char *) &x; |
diff --git a/src/lib/libc/net/ns_ntoa.c b/src/lib/libc/net/ns_ntoa.c index ad3265399b..777028cff2 100644 --- a/src/lib/libc/net/ns_ntoa.c +++ b/src/lib/libc/net/ns_ntoa.c | |||
| @@ -45,6 +45,8 @@ static char rcsid[] = "$NetBSD: ns_ntoa.c,v 1.4 1995/02/25 06:20:51 cgd Exp $"; | |||
| 45 | #include <netns/ns.h> | 45 | #include <netns/ns.h> |
| 46 | #include <stdio.h> | 46 | #include <stdio.h> |
| 47 | 47 | ||
| 48 | static char *spectHex __P((char *)); | ||
| 49 | |||
| 48 | char * | 50 | char * |
| 49 | ns_ntoa(addr) | 51 | ns_ntoa(addr) |
| 50 | struct ns_addr addr; | 52 | struct ns_addr addr; |
| @@ -56,7 +58,6 @@ ns_ntoa(addr) | |||
| 56 | char *cp2; | 58 | char *cp2; |
| 57 | register u_char *up = addr.x_host.c_host; | 59 | register u_char *up = addr.x_host.c_host; |
| 58 | u_char *uplim = up + 6; | 60 | u_char *uplim = up + 6; |
| 59 | static char *spectHex(); | ||
| 60 | 61 | ||
| 61 | net.net_e = addr.x_net; | 62 | net.net_e = addr.x_net; |
| 62 | sprintf(obuf, "%lx", ntohl(net.long_e)); | 63 | sprintf(obuf, "%lx", ntohl(net.long_e)); |
diff --git a/src/lib/libc/net/ntohs.c b/src/lib/libc/net/ntohs.c index 93ab83ee4d..6e180c16ab 100644 --- a/src/lib/libc/net/ntohs.c +++ b/src/lib/libc/net/ntohs.c | |||
| @@ -15,8 +15,12 @@ static char *rcsid = "$NetBSD: ntohs.c,v 1.5 1995/04/28 23:25:23 jtc Exp $"; | |||
| 15 | #undef ntohs | 15 | #undef ntohs |
| 16 | 16 | ||
| 17 | unsigned short | 17 | unsigned short |
| 18 | #if __STDC__ | ||
| 19 | ntohs(unsigned short x) | ||
| 20 | #else | ||
| 18 | ntohs(x) | 21 | ntohs(x) |
| 19 | unsigned short x; | 22 | unsigned short x; |
| 23 | #endif | ||
| 20 | { | 24 | { |
| 21 | #if BYTE_ORDER == LITTLE_ENDIAN | 25 | #if BYTE_ORDER == LITTLE_ENDIAN |
| 22 | u_char *s = (u_char *) &x; | 26 | u_char *s = (u_char *) &x; |
