diff options
43 files changed, 348 insertions, 665 deletions
diff --git a/src/lib/libc/net/ethers.c b/src/lib/libc/net/ethers.c index 2c1e562245..0a86a30af2 100644 --- a/src/lib/libc/net/ethers.c +++ b/src/lib/libc/net/ethers.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ethers.c,v 1.17 2004/02/16 19:41:12 otto Exp $ */ | 1 | /* $OpenBSD: ethers.c,v 1.18 2005/03/25 13:24:11 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> | 4 | * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> |
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #if defined(LIBC_SCCS) && !defined(lint) | 25 | #if defined(LIBC_SCCS) && !defined(lint) |
26 | static char rcsid[] = "$OpenBSD: ethers.c,v 1.17 2004/02/16 19:41:12 otto Exp $"; | 26 | static char rcsid[] = "$OpenBSD: ethers.c,v 1.18 2005/03/25 13:24:11 otto Exp $"; |
27 | #endif /* LIBC_SCCS and not lint */ | 27 | #endif /* LIBC_SCCS and not lint */ |
28 | 28 | ||
29 | #include <sys/types.h> | 29 | #include <sys/types.h> |
@@ -49,8 +49,7 @@ static char rcsid[] = "$OpenBSD: ethers.c,v 1.17 2004/02/16 19:41:12 otto Exp $" | |||
49 | static char * _ether_aton(char *, struct ether_addr *); | 49 | static char * _ether_aton(char *, struct ether_addr *); |
50 | 50 | ||
51 | char * | 51 | char * |
52 | ether_ntoa(e) | 52 | ether_ntoa(struct ether_addr *e) |
53 | struct ether_addr *e; | ||
54 | { | 53 | { |
55 | static char a[] = "xx:xx:xx:xx:xx:xx"; | 54 | static char a[] = "xx:xx:xx:xx:xx:xx"; |
56 | 55 | ||
@@ -63,9 +62,7 @@ ether_ntoa(e) | |||
63 | } | 62 | } |
64 | 63 | ||
65 | static char * | 64 | static char * |
66 | _ether_aton(s, e) | 65 | _ether_aton(char *s, struct ether_addr *e) |
67 | char *s; | ||
68 | struct ether_addr *e; | ||
69 | { | 66 | { |
70 | int i; | 67 | int i; |
71 | long l; | 68 | long l; |
@@ -90,8 +87,7 @@ _ether_aton(s, e) | |||
90 | } | 87 | } |
91 | 88 | ||
92 | struct ether_addr * | 89 | struct ether_addr * |
93 | ether_aton(s) | 90 | ether_aton(char *s) |
94 | char *s; | ||
95 | { | 91 | { |
96 | static struct ether_addr n; | 92 | static struct ether_addr n; |
97 | 93 | ||
@@ -99,9 +95,7 @@ ether_aton(s) | |||
99 | } | 95 | } |
100 | 96 | ||
101 | int | 97 | int |
102 | ether_ntohost(hostname, e) | 98 | ether_ntohost(char *hostname, struct ether_addr *e) |
103 | char *hostname; | ||
104 | struct ether_addr *e; | ||
105 | { | 99 | { |
106 | FILE *f; | 100 | FILE *f; |
107 | char buf[BUFSIZ+1], *p; | 101 | char buf[BUFSIZ+1], *p; |
@@ -163,9 +157,7 @@ ether_ntohost(hostname, e) | |||
163 | } | 157 | } |
164 | 158 | ||
165 | int | 159 | int |
166 | ether_hostton(hostname, e) | 160 | ether_hostton(char *hostname, struct ether_addr *e) |
167 | char *hostname; | ||
168 | struct ether_addr *e; | ||
169 | { | 161 | { |
170 | FILE *f; | 162 | FILE *f; |
171 | char buf[BUFSIZ+1], *p; | 163 | char buf[BUFSIZ+1], *p; |
@@ -218,10 +210,7 @@ ether_hostton(hostname, e) | |||
218 | } | 210 | } |
219 | 211 | ||
220 | int | 212 | int |
221 | ether_line(line, e, hostname) | 213 | ether_line(char *line, struct ether_addr *e, char *hostname) |
222 | char *line; | ||
223 | struct ether_addr *e; | ||
224 | char *hostname; | ||
225 | { | 214 | { |
226 | char *p; | 215 | char *p; |
227 | size_t n; | 216 | size_t n; |
diff --git a/src/lib/libc/net/freeaddrinfo.c b/src/lib/libc/net/freeaddrinfo.c index ebbc2492df..58702d0b18 100644 --- a/src/lib/libc/net/freeaddrinfo.c +++ b/src/lib/libc/net/freeaddrinfo.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: freeaddrinfo.c,v 1.5 2004/10/01 04:08:45 jsg Exp $ */ | 1 | /* $OpenBSD: freeaddrinfo.c,v 1.6 2005/03/25 13:24:11 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1996, 1997, 1998, 1999, Craig Metz, All rights reserved. | 4 | * Copyright (c) 1996, 1997, 1998, 1999, Craig Metz, All rights reserved. |
@@ -36,8 +36,7 @@ | |||
36 | #include <netdb.h> | 36 | #include <netdb.h> |
37 | 37 | ||
38 | void | 38 | void |
39 | freeaddrinfo(ai) | 39 | freeaddrinfo(struct addrinfo *ai) |
40 | struct addrinfo *ai; | ||
41 | { | 40 | { |
42 | struct addrinfo *p; | 41 | struct addrinfo *p; |
43 | 42 | ||
diff --git a/src/lib/libc/net/getaddrinfo.c b/src/lib/libc/net/getaddrinfo.c index 3db8cc82ee..c7cc0500c3 100644 --- a/src/lib/libc/net/getaddrinfo.c +++ b/src/lib/libc/net/getaddrinfo.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: getaddrinfo.c,v 1.50 2004/06/07 21:11:23 marc Exp $ */ | 1 | /* $OpenBSD: getaddrinfo.c,v 1.51 2005/03/25 13:24:12 otto Exp $ */ |
2 | /* $KAME: getaddrinfo.c,v 1.31 2000/08/31 17:36:43 itojun Exp $ */ | 2 | /* $KAME: getaddrinfo.c,v 1.31 2000/08/31 17:36:43 itojun Exp $ */ |
3 | 3 | ||
4 | /* | 4 | /* |
@@ -279,8 +279,7 @@ do { \ | |||
279 | ((x) == (y) || (/*CONSTCOND*/(w) && ((x) == ANY || (y) == ANY))) | 279 | ((x) == (y) || (/*CONSTCOND*/(w) && ((x) == ANY || (y) == ANY))) |
280 | 280 | ||
281 | static int | 281 | static int |
282 | str2number(p) | 282 | str2number(const char *p) |
283 | const char *p; | ||
284 | { | 283 | { |
285 | char *ep; | 284 | char *ep; |
286 | unsigned long v; | 285 | unsigned long v; |
@@ -297,10 +296,8 @@ str2number(p) | |||
297 | } | 296 | } |
298 | 297 | ||
299 | int | 298 | int |
300 | getaddrinfo(hostname, servname, hints, res) | 299 | getaddrinfo(const char *hostname, const char *servname, |
301 | const char *hostname, *servname; | 300 | const struct addrinfo *hints, struct addrinfo **res) |
302 | const struct addrinfo *hints; | ||
303 | struct addrinfo **res; | ||
304 | { | 301 | { |
305 | struct addrinfo sentinel; | 302 | struct addrinfo sentinel; |
306 | struct addrinfo *cur; | 303 | struct addrinfo *cur; |
@@ -499,11 +496,8 @@ getaddrinfo(hostname, servname, hints, res) | |||
499 | */ | 496 | */ |
500 | 497 | ||
501 | static int | 498 | static int |
502 | explore_fqdn(pai, hostname, servname, res) | 499 | explore_fqdn(const struct addrinfo *pai, const char *hostname, |
503 | const struct addrinfo *pai; | 500 | const char *servname, struct addrinfo **res) |
504 | const char *hostname; | ||
505 | const char *servname; | ||
506 | struct addrinfo **res; | ||
507 | { | 501 | { |
508 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 502 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
509 | struct addrinfo *result; | 503 | struct addrinfo *result; |
@@ -597,10 +591,8 @@ free: | |||
597 | * non-passive socket -> localhost (127.0.0.1 or ::1) | 591 | * non-passive socket -> localhost (127.0.0.1 or ::1) |
598 | */ | 592 | */ |
599 | static int | 593 | static int |
600 | explore_null(pai, servname, res) | 594 | explore_null(const struct addrinfo *pai, const char *servname, |
601 | const struct addrinfo *pai; | 595 | struct addrinfo **res) |
602 | const char *servname; | ||
603 | struct addrinfo **res; | ||
604 | { | 596 | { |
605 | int s; | 597 | int s; |
606 | const struct afd *afd; | 598 | const struct afd *afd; |
@@ -661,12 +653,8 @@ free: | |||
661 | * numeric hostname | 653 | * numeric hostname |
662 | */ | 654 | */ |
663 | static int | 655 | static int |
664 | explore_numeric(pai, hostname, servname, res, canonname) | 656 | explore_numeric(const struct addrinfo *pai, const char *hostname, |
665 | const struct addrinfo *pai; | 657 | const char *servname, struct addrinfo **res, const char *canonname) |
666 | const char *hostname; | ||
667 | const char *servname; | ||
668 | struct addrinfo **res; | ||
669 | const char *canonname; | ||
670 | { | 658 | { |
671 | const struct afd *afd; | 659 | const struct afd *afd; |
672 | struct addrinfo *cur; | 660 | struct addrinfo *cur; |
@@ -747,11 +735,8 @@ bad: | |||
747 | * numeric hostname with scope | 735 | * numeric hostname with scope |
748 | */ | 736 | */ |
749 | static int | 737 | static int |
750 | explore_numeric_scope(pai, hostname, servname, res) | 738 | explore_numeric_scope(const struct addrinfo *pai, const char *hostname, |
751 | const struct addrinfo *pai; | 739 | const char *servname, struct addrinfo **res) |
752 | const char *hostname; | ||
753 | const char *servname; | ||
754 | struct addrinfo **res; | ||
755 | { | 740 | { |
756 | #if !defined(SCOPE_DELIMITER) || !defined(INET6) | 741 | #if !defined(SCOPE_DELIMITER) || !defined(INET6) |
757 | return explore_numeric(pai, hostname, servname, res, hostname); | 742 | return explore_numeric(pai, hostname, servname, res, hostname); |
@@ -813,10 +798,7 @@ explore_numeric_scope(pai, hostname, servname, res) | |||
813 | } | 798 | } |
814 | 799 | ||
815 | static int | 800 | static int |
816 | get_canonname(pai, ai, str) | 801 | get_canonname(const struct addrinfo *pai, struct addrinfo *ai, const char *str) |
817 | const struct addrinfo *pai; | ||
818 | struct addrinfo *ai; | ||
819 | const char *str; | ||
820 | { | 802 | { |
821 | if ((pai->ai_flags & AI_CANONNAME) != 0) { | 803 | if ((pai->ai_flags & AI_CANONNAME) != 0) { |
822 | ai->ai_canonname = strdup(str); | 804 | ai->ai_canonname = strdup(str); |
@@ -827,10 +809,7 @@ get_canonname(pai, ai, str) | |||
827 | } | 809 | } |
828 | 810 | ||
829 | static struct addrinfo * | 811 | static struct addrinfo * |
830 | get_ai(pai, afd, addr) | 812 | get_ai(const struct addrinfo *pai, const struct afd *afd, const char *addr) |
831 | const struct addrinfo *pai; | ||
832 | const struct afd *afd; | ||
833 | const char *addr; | ||
834 | { | 813 | { |
835 | char *p; | 814 | char *p; |
836 | struct addrinfo *ai; | 815 | struct addrinfo *ai; |
@@ -852,9 +831,7 @@ get_ai(pai, afd, addr) | |||
852 | } | 831 | } |
853 | 832 | ||
854 | static int | 833 | static int |
855 | get_portmatch(ai, servname) | 834 | get_portmatch(const struct addrinfo *ai, const char *servname) |
856 | const struct addrinfo *ai; | ||
857 | const char *servname; | ||
858 | { | 835 | { |
859 | 836 | ||
860 | /* get_port does not touch first argument. when matchonly == 1. */ | 837 | /* get_port does not touch first argument. when matchonly == 1. */ |
@@ -863,10 +840,7 @@ get_portmatch(ai, servname) | |||
863 | } | 840 | } |
864 | 841 | ||
865 | static int | 842 | static int |
866 | get_port(ai, servname, matchonly) | 843 | get_port(struct addrinfo *ai, const char *servname, int matchonly) |
867 | struct addrinfo *ai; | ||
868 | const char *servname; | ||
869 | int matchonly; | ||
870 | { | 844 | { |
871 | const char *proto; | 845 | const char *proto; |
872 | struct servent *sp; | 846 | struct servent *sp; |
@@ -951,8 +925,7 @@ get_port(ai, servname, matchonly) | |||
951 | } | 925 | } |
952 | 926 | ||
953 | static const struct afd * | 927 | static const struct afd * |
954 | find_afd(af) | 928 | find_afd(int af) |
955 | int af; | ||
956 | { | 929 | { |
957 | const struct afd *afd; | 930 | const struct afd *afd; |
958 | 931 | ||
@@ -968,10 +941,7 @@ find_afd(af) | |||
968 | #ifdef INET6 | 941 | #ifdef INET6 |
969 | /* convert a string to a scope identifier. XXX: IPv6 specific */ | 942 | /* convert a string to a scope identifier. XXX: IPv6 specific */ |
970 | static int | 943 | static int |
971 | ip6_str2scopeid(scope, sin6, scopeid) | 944 | ip6_str2scopeid(char *scope, struct sockaddr_in6 *sin6, u_int32_t *scopeid) |
972 | char *scope; | ||
973 | struct sockaddr_in6 *sin6; | ||
974 | u_int32_t *scopeid; | ||
975 | { | 945 | { |
976 | u_long lscopeid; | 946 | u_long lscopeid; |
977 | struct in6_addr *a6 = &sin6->sin6_addr; | 947 | struct in6_addr *a6 = &sin6->sin6_addr; |
@@ -1020,12 +990,8 @@ static const char AskedForGot[] = | |||
1020 | static FILE *hostf = NULL; | 990 | static FILE *hostf = NULL; |
1021 | 991 | ||
1022 | static struct addrinfo * | 992 | static struct addrinfo * |
1023 | getanswer(answer, anslen, qname, qtype, pai) | 993 | getanswer(const querybuf *answer, int anslen, const char *qname, int qtype, |
1024 | const querybuf *answer; | 994 | const struct addrinfo *pai) |
1025 | int anslen; | ||
1026 | const char *qname; | ||
1027 | int qtype; | ||
1028 | const struct addrinfo *pai; | ||
1029 | { | 995 | { |
1030 | struct addrinfo sentinel, *cur; | 996 | struct addrinfo sentinel, *cur; |
1031 | struct addrinfo ai; | 997 | struct addrinfo ai; |
@@ -1212,9 +1178,7 @@ getanswer(answer, anslen, qname, qtype, pai) | |||
1212 | 1178 | ||
1213 | /*ARGSUSED*/ | 1179 | /*ARGSUSED*/ |
1214 | static struct addrinfo * | 1180 | static struct addrinfo * |
1215 | _dns_getaddrinfo(name, pai) | 1181 | _dns_getaddrinfo(const char *name, const struct addrinfo *pai) |
1216 | const char *name; | ||
1217 | const struct addrinfo *pai; | ||
1218 | { | 1182 | { |
1219 | struct addrinfo *ai; | 1183 | struct addrinfo *ai; |
1220 | querybuf *buf, *buf2; | 1184 | querybuf *buf, *buf2; |
@@ -1292,7 +1256,7 @@ _dns_getaddrinfo(name, pai) | |||
1292 | static FILE *hostf; | 1256 | static FILE *hostf; |
1293 | 1257 | ||
1294 | static void | 1258 | static void |
1295 | _sethtent() | 1259 | _sethtent(void) |
1296 | { | 1260 | { |
1297 | if (!hostf) | 1261 | if (!hostf) |
1298 | hostf = fopen(_PATH_HOSTS, "r" ); | 1262 | hostf = fopen(_PATH_HOSTS, "r" ); |
@@ -1301,7 +1265,7 @@ _sethtent() | |||
1301 | } | 1265 | } |
1302 | 1266 | ||
1303 | static void | 1267 | static void |
1304 | _endhtent() | 1268 | _endhtent(void) |
1305 | { | 1269 | { |
1306 | if (hostf) { | 1270 | if (hostf) { |
1307 | (void) fclose(hostf); | 1271 | (void) fclose(hostf); |
@@ -1310,9 +1274,7 @@ _endhtent() | |||
1310 | } | 1274 | } |
1311 | 1275 | ||
1312 | static struct addrinfo * | 1276 | static struct addrinfo * |
1313 | _gethtent(name, pai) | 1277 | _gethtent(const char *name, const struct addrinfo *pai) |
1314 | const char *name; | ||
1315 | const struct addrinfo *pai; | ||
1316 | { | 1278 | { |
1317 | char *p; | 1279 | char *p; |
1318 | char *cp, *tname, *cname; | 1280 | char *cp, *tname, *cname; |
@@ -1374,9 +1336,7 @@ found: | |||
1374 | 1336 | ||
1375 | /*ARGSUSED*/ | 1337 | /*ARGSUSED*/ |
1376 | static struct addrinfo * | 1338 | static struct addrinfo * |
1377 | _files_getaddrinfo(name, pai) | 1339 | _files_getaddrinfo(const char *name, const struct addrinfo *pai) |
1378 | const char *name; | ||
1379 | const struct addrinfo *pai; | ||
1380 | { | 1340 | { |
1381 | struct addrinfo sentinel, *cur; | 1341 | struct addrinfo sentinel, *cur; |
1382 | struct addrinfo *p; | 1342 | struct addrinfo *p; |
@@ -1400,9 +1360,7 @@ static char *__ypdomain; | |||
1400 | 1360 | ||
1401 | /*ARGSUSED*/ | 1361 | /*ARGSUSED*/ |
1402 | static struct addrinfo * | 1362 | static struct addrinfo * |
1403 | _yphostent(line, pai) | 1363 | _yphostent(char *line, const struct addrinfo *pai) |
1404 | char *line; | ||
1405 | const struct addrinfo *pai; | ||
1406 | { | 1364 | { |
1407 | struct addrinfo sentinel, *cur; | 1365 | struct addrinfo sentinel, *cur; |
1408 | struct addrinfo hints, *res, *res0; | 1366 | struct addrinfo hints, *res, *res0; |
@@ -1478,9 +1436,7 @@ done: | |||
1478 | 1436 | ||
1479 | /*ARGSUSED*/ | 1437 | /*ARGSUSED*/ |
1480 | static struct addrinfo * | 1438 | static struct addrinfo * |
1481 | _yp_getaddrinfo(name, pai) | 1439 | _yp_getaddrinfo(const char *name, const struct addrinfo *pai) |
1482 | const char *name; | ||
1483 | const struct addrinfo *pai; | ||
1484 | { | 1440 | { |
1485 | struct addrinfo sentinel, *cur; | 1441 | struct addrinfo sentinel, *cur; |
1486 | struct addrinfo *ai = NULL; | 1442 | struct addrinfo *ai = NULL; |
@@ -1550,9 +1506,7 @@ extern int res_opt(int, u_char *, int, int); | |||
1550 | * Caller must parse answer and determine whether it answers the question. | 1506 | * Caller must parse answer and determine whether it answers the question. |
1551 | */ | 1507 | */ |
1552 | static int | 1508 | static int |
1553 | res_queryN(name, target) | 1509 | res_queryN(const char *name, struct res_target *target) |
1554 | const char *name; /* domain name */ | ||
1555 | struct res_target *target; | ||
1556 | { | 1510 | { |
1557 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 1511 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
1558 | u_char *buf; | 1512 | u_char *buf; |
@@ -1668,9 +1622,7 @@ res_queryN(name, target) | |||
1668 | * is detected. Error code, if any, is left in h_errno. | 1622 | * is detected. Error code, if any, is left in h_errno. |
1669 | */ | 1623 | */ |
1670 | static int | 1624 | static int |
1671 | res_searchN(name, target) | 1625 | res_searchN(const char *name, struct res_target *target) |
1672 | const char *name; /* domain name */ | ||
1673 | struct res_target *target; | ||
1674 | { | 1626 | { |
1675 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 1627 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
1676 | const char *cp, * const *domain; | 1628 | const char *cp, * const *domain; |
@@ -1808,9 +1760,8 @@ res_searchN(name, target) | |||
1808 | * removing a trailing dot from name if domain is NULL. | 1760 | * removing a trailing dot from name if domain is NULL. |
1809 | */ | 1761 | */ |
1810 | static int | 1762 | static int |
1811 | res_querydomainN(name, domain, target) | 1763 | res_querydomainN(const char *name, const char *domain, |
1812 | const char *name, *domain; | 1764 | struct res_target *target) |
1813 | struct res_target *target; | ||
1814 | { | 1765 | { |
1815 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 1766 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
1816 | char nbuf[MAXDNAME]; | 1767 | char nbuf[MAXDNAME]; |
diff --git a/src/lib/libc/net/getnameinfo.c b/src/lib/libc/net/getnameinfo.c index 8681137fd7..830a94279e 100644 --- a/src/lib/libc/net/getnameinfo.c +++ b/src/lib/libc/net/getnameinfo.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: getnameinfo.c,v 1.29 2004/09/15 19:01:28 deraadt Exp $ */ | 1 | /* $OpenBSD: getnameinfo.c,v 1.30 2005/03/25 13:24:12 otto Exp $ */ |
2 | /* $KAME: getnameinfo.c,v 1.45 2000/09/25 22:43:56 itojun Exp $ */ | 2 | /* $KAME: getnameinfo.c,v 1.45 2000/09/25 22:43:56 itojun Exp $ */ |
3 | 3 | ||
4 | /* | 4 | /* |
@@ -94,14 +94,8 @@ static int ip6_sa2str(const struct sockaddr_in6 *, char *, size_t, int); | |||
94 | void *__THREAD_NAME(serv_mutex); | 94 | void *__THREAD_NAME(serv_mutex); |
95 | 95 | ||
96 | int | 96 | int |
97 | getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) | 97 | getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, |
98 | const struct sockaddr *sa; | 98 | size_t hostlen, char *serv, size_t servlen, int flags) |
99 | socklen_t salen; | ||
100 | char *host; | ||
101 | size_t hostlen; | ||
102 | char *serv; | ||
103 | size_t servlen; | ||
104 | int flags; | ||
105 | { | 99 | { |
106 | const struct afd *afd; | 100 | const struct afd *afd; |
107 | struct servent *sp; | 101 | struct servent *sp; |
@@ -286,12 +280,8 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) | |||
286 | 280 | ||
287 | #ifdef INET6 | 281 | #ifdef INET6 |
288 | static int | 282 | static int |
289 | ip6_parsenumeric(sa, addr, host, hostlen, flags) | 283 | ip6_parsenumeric(const struct sockaddr *sa, const char *addr, char *host, |
290 | const struct sockaddr *sa; | 284 | size_t hostlen, int flags) |
291 | const char *addr; | ||
292 | char *host; | ||
293 | size_t hostlen; | ||
294 | int flags; | ||
295 | { | 285 | { |
296 | int numaddrlen; | 286 | int numaddrlen; |
297 | char numaddr[512]; | 287 | char numaddr[512]; |
@@ -328,11 +318,7 @@ ip6_parsenumeric(sa, addr, host, hostlen, flags) | |||
328 | 318 | ||
329 | /* ARGSUSED */ | 319 | /* ARGSUSED */ |
330 | static int | 320 | static int |
331 | ip6_sa2str(sa6, buf, bufsiz, flags) | 321 | ip6_sa2str(const struct sockaddr_in6 *sa6, char *buf, size_t bufsiz, int flags) |
332 | const struct sockaddr_in6 *sa6; | ||
333 | char *buf; | ||
334 | size_t bufsiz; | ||
335 | int flags; | ||
336 | { | 322 | { |
337 | unsigned int ifindex; | 323 | unsigned int ifindex; |
338 | const struct in6_addr *a6; | 324 | const struct in6_addr *a6; |
diff --git a/src/lib/libc/net/getnetbyaddr.c b/src/lib/libc/net/getnetbyaddr.c index 29365d4735..82d1ea1dca 100644 --- a/src/lib/libc/net/getnetbyaddr.c +++ b/src/lib/libc/net/getnetbyaddr.c | |||
@@ -28,7 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #if defined(LIBC_SCCS) && !defined(lint) | 30 | #if defined(LIBC_SCCS) && !defined(lint) |
31 | static char rcsid[] = "$OpenBSD: getnetbyaddr.c,v 1.6 2003/06/02 20:18:35 millert Exp $"; | 31 | static char rcsid[] = "$OpenBSD: getnetbyaddr.c,v 1.7 2005/03/25 13:24:12 otto Exp $"; |
32 | #endif /* LIBC_SCCS and not lint */ | 32 | #endif /* LIBC_SCCS and not lint */ |
33 | 33 | ||
34 | #include <netdb.h> | 34 | #include <netdb.h> |
@@ -36,11 +36,9 @@ static char rcsid[] = "$OpenBSD: getnetbyaddr.c,v 1.6 2003/06/02 20:18:35 miller | |||
36 | extern int _net_stayopen; | 36 | extern int _net_stayopen; |
37 | 37 | ||
38 | struct netent * | 38 | struct netent * |
39 | _getnetbyaddr(net, type) | 39 | _getnetbyaddr(in_addr_t net, int type) |
40 | register in_addr_t net; | ||
41 | register int type; | ||
42 | { | 40 | { |
43 | register struct netent *p; | 41 | struct netent *p; |
44 | 42 | ||
45 | setnetent(_net_stayopen); | 43 | setnetent(_net_stayopen); |
46 | while ((p = getnetent())) | 44 | while ((p = getnetent())) |
diff --git a/src/lib/libc/net/getnetbyname.c b/src/lib/libc/net/getnetbyname.c index 04ab7b6332..83b3ca3817 100644 --- a/src/lib/libc/net/getnetbyname.c +++ b/src/lib/libc/net/getnetbyname.c | |||
@@ -28,7 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #if defined(LIBC_SCCS) && !defined(lint) | 30 | #if defined(LIBC_SCCS) && !defined(lint) |
31 | static char rcsid[] = "$OpenBSD: getnetbyname.c,v 1.6 2003/06/02 20:18:35 millert Exp $"; | 31 | static char rcsid[] = "$OpenBSD: getnetbyname.c,v 1.7 2005/03/25 13:24:12 otto Exp $"; |
32 | #endif /* LIBC_SCCS and not lint */ | 32 | #endif /* LIBC_SCCS and not lint */ |
33 | 33 | ||
34 | #include <netdb.h> | 34 | #include <netdb.h> |
@@ -37,11 +37,10 @@ static char rcsid[] = "$OpenBSD: getnetbyname.c,v 1.6 2003/06/02 20:18:35 miller | |||
37 | extern int _net_stayopen; | 37 | extern int _net_stayopen; |
38 | 38 | ||
39 | struct netent * | 39 | struct netent * |
40 | _getnetbyname(name) | 40 | _getnetbyname(const char *name) |
41 | register const char *name; | ||
42 | { | 41 | { |
43 | register struct netent *p; | 42 | struct netent *p; |
44 | register char **cp; | 43 | char **cp; |
45 | 44 | ||
46 | setnetent(_net_stayopen); | 45 | setnetent(_net_stayopen); |
47 | while ((p = getnetent())) { | 46 | while ((p = getnetent())) { |
diff --git a/src/lib/libc/net/getnetent.c b/src/lib/libc/net/getnetent.c index 4c3b38e7d8..3e52c1ff4d 100644 --- a/src/lib/libc/net/getnetent.c +++ b/src/lib/libc/net/getnetent.c | |||
@@ -28,7 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #if defined(LIBC_SCCS) && !defined(lint) | 30 | #if defined(LIBC_SCCS) && !defined(lint) |
31 | static char rcsid[] = "$OpenBSD: getnetent.c,v 1.9 2003/06/02 20:18:35 millert Exp $"; | 31 | static char rcsid[] = "$OpenBSD: getnetent.c,v 1.10 2005/03/25 13:24:12 otto Exp $"; |
32 | #endif /* LIBC_SCCS and not lint */ | 32 | #endif /* LIBC_SCCS and not lint */ |
33 | 33 | ||
34 | #include <sys/types.h> | 34 | #include <sys/types.h> |
@@ -48,8 +48,7 @@ static char *net_aliases[MAXALIASES]; | |||
48 | int _net_stayopen; | 48 | int _net_stayopen; |
49 | 49 | ||
50 | void | 50 | void |
51 | setnetent(f) | 51 | setnetent(int f) |
52 | int f; | ||
53 | { | 52 | { |
54 | if (netf == NULL) | 53 | if (netf == NULL) |
55 | netf = fopen(_PATH_NETWORKS, "r" ); | 54 | netf = fopen(_PATH_NETWORKS, "r" ); |
@@ -59,7 +58,7 @@ setnetent(f) | |||
59 | } | 58 | } |
60 | 59 | ||
61 | void | 60 | void |
62 | endnetent() | 61 | endnetent(void) |
63 | { | 62 | { |
64 | if (netf) { | 63 | if (netf) { |
65 | fclose(netf); | 64 | fclose(netf); |
@@ -69,7 +68,7 @@ endnetent() | |||
69 | } | 68 | } |
70 | 69 | ||
71 | struct netent * | 70 | struct netent * |
72 | getnetent() | 71 | getnetent(void) |
73 | { | 72 | { |
74 | char *p, *cp, **q; | 73 | char *p, *cp, **q; |
75 | size_t len; | 74 | size_t len; |
diff --git a/src/lib/libc/net/getnetnamadr.c b/src/lib/libc/net/getnetnamadr.c index 149216ffd8..42410264b1 100644 --- a/src/lib/libc/net/getnetnamadr.c +++ b/src/lib/libc/net/getnetnamadr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: getnetnamadr.c,v 1.23 2003/06/03 21:09:00 deraadt Exp $ */ | 1 | /* $OpenBSD: getnetnamadr.c,v 1.24 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1997, Jason Downs. All rights reserved. | 4 | * Copyright (c) 1997, Jason Downs. All rights reserved. |
@@ -66,7 +66,7 @@ static char sccsid[] = "@(#)getnetbyaddr.c 8.1 (Berkeley) 6/4/93"; | |||
66 | static char sccsid_[] = "from getnetnamadr.c 1.4 (Coimbra) 93/06/03"; | 66 | static char sccsid_[] = "from getnetnamadr.c 1.4 (Coimbra) 93/06/03"; |
67 | static char rcsid[] = "$From: getnetnamadr.c,v 8.7 1996/08/05 08:31:35 vixie Exp $"; | 67 | static char rcsid[] = "$From: getnetnamadr.c,v 8.7 1996/08/05 08:31:35 vixie Exp $"; |
68 | #else | 68 | #else |
69 | static char rcsid[] = "$OpenBSD: getnetnamadr.c,v 1.23 2003/06/03 21:09:00 deraadt Exp $"; | 69 | static char rcsid[] = "$OpenBSD: getnetnamadr.c,v 1.24 2005/03/25 13:24:12 otto Exp $"; |
70 | #endif | 70 | #endif |
71 | #endif /* LIBC_SCCS and not lint */ | 71 | #endif /* LIBC_SCCS and not lint */ |
72 | 72 | ||
@@ -111,15 +111,12 @@ typedef union { | |||
111 | } align; | 111 | } align; |
112 | 112 | ||
113 | static struct netent * | 113 | static struct netent * |
114 | getnetanswer(answer, anslen, net_i) | 114 | getnetanswer(querybuf *answer, int anslen, int net_i) |
115 | querybuf *answer; | ||
116 | int anslen; | ||
117 | int net_i; | ||
118 | { | 115 | { |
119 | 116 | ||
120 | register HEADER *hp; | 117 | HEADER *hp; |
121 | register u_char *cp; | 118 | u_char *cp; |
122 | register int n; | 119 | int n; |
123 | u_char *eom; | 120 | u_char *eom; |
124 | int type, class, ancount, qdcount, haveanswer, i, nchar; | 121 | int type, class, ancount, qdcount, haveanswer, i, nchar; |
125 | char aux1[MAXHOSTNAMELEN], aux2[MAXHOSTNAMELEN], ans[MAXHOSTNAMELEN]; | 122 | char aux1[MAXHOSTNAMELEN], aux2[MAXHOSTNAMELEN], ans[MAXHOSTNAMELEN]; |
@@ -250,9 +247,7 @@ getnetanswer(answer, anslen, net_i) | |||
250 | } | 247 | } |
251 | 248 | ||
252 | struct netent * | 249 | struct netent * |
253 | getnetbyaddr(net, net_type) | 250 | getnetbyaddr(in_addr_t net, int net_type) |
254 | register in_addr_t net; | ||
255 | register int net_type; | ||
256 | { | 251 | { |
257 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 252 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
258 | unsigned int netbr[4]; | 253 | unsigned int netbr[4]; |
@@ -342,8 +337,7 @@ getnetbyaddr(net, net_type) | |||
342 | } | 337 | } |
343 | 338 | ||
344 | struct netent * | 339 | struct netent * |
345 | getnetbyname(net) | 340 | getnetbyname(const char *net) |
346 | register const char *net; | ||
347 | { | 341 | { |
348 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 342 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
349 | int anslen; | 343 | int anslen; |
diff --git a/src/lib/libc/net/getrrsetbyname.c b/src/lib/libc/net/getrrsetbyname.c index 60610e4943..dcfc86a691 100644 --- a/src/lib/libc/net/getrrsetbyname.c +++ b/src/lib/libc/net/getrrsetbyname.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: getrrsetbyname.c,v 1.8 2004/07/18 19:07:38 jakob Exp $ */ | 1 | /* $OpenBSD: getrrsetbyname.c,v 1.9 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2001 Jakob Schlyter. All rights reserved. | 4 | * Copyright (c) 2001 Jakob Schlyter. All rights reserved. |
@@ -397,7 +397,8 @@ parse_dns_qsection(const u_char *answer, int size, const u_char **cp, int count) | |||
397 | } | 397 | } |
398 | 398 | ||
399 | static struct dns_rr * | 399 | static struct dns_rr * |
400 | parse_dns_rrsection(const u_char *answer, int size, const u_char **cp, int count) | 400 | parse_dns_rrsection(const u_char *answer, int size, const u_char **cp, |
401 | int count) | ||
401 | { | 402 | { |
402 | struct dns_rr *head, *curr, *prev; | 403 | struct dns_rr *head, *curr, *prev; |
403 | int i, length; | 404 | int i, length; |
diff --git a/src/lib/libc/net/herror.c b/src/lib/libc/net/herror.c index 64d4d55486..c1e5a4ba56 100644 --- a/src/lib/libc/net/herror.c +++ b/src/lib/libc/net/herror.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: herror.c,v 1.6 2005/03/02 12:26:24 millert Exp $ */ | 1 | /* $OpenBSD: herror.c,v 1.7 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * ++Copyright++ 1987, 1993 | 4 | * ++Copyright++ 1987, 1993 |
@@ -56,7 +56,7 @@ | |||
56 | static char sccsid[] = "@(#)herror.c 8.1 (Berkeley) 6/4/93"; | 56 | static char sccsid[] = "@(#)herror.c 8.1 (Berkeley) 6/4/93"; |
57 | static char rcsid[] = "$From: herror.c,v 8.3 1996/08/05 08:31:35 vixie Exp $"; | 57 | static char rcsid[] = "$From: herror.c,v 8.3 1996/08/05 08:31:35 vixie Exp $"; |
58 | #else | 58 | #else |
59 | static char rcsid[] = "$OpenBSD: herror.c,v 1.6 2005/03/02 12:26:24 millert Exp $"; | 59 | static char rcsid[] = "$OpenBSD: herror.c,v 1.7 2005/03/25 13:24:12 otto Exp $"; |
60 | #endif | 60 | #endif |
61 | #endif /* LIBC_SCCS and not lint */ | 61 | #endif /* LIBC_SCCS and not lint */ |
62 | 62 | ||
@@ -83,11 +83,10 @@ extern int h_errno; | |||
83 | * print the error indicated by the h_errno value. | 83 | * print the error indicated by the h_errno value. |
84 | */ | 84 | */ |
85 | void | 85 | void |
86 | herror(s) | 86 | herror(const char *s) |
87 | const char *s; | ||
88 | { | 87 | { |
89 | struct iovec iov[4]; | 88 | struct iovec iov[4]; |
90 | register struct iovec *v = iov; | 89 | struct iovec *v = iov; |
91 | 90 | ||
92 | if (s && *s) { | 91 | if (s && *s) { |
93 | v->iov_base = (char *)s; | 92 | v->iov_base = (char *)s; |
@@ -106,8 +105,7 @@ herror(s) | |||
106 | } | 105 | } |
107 | 106 | ||
108 | const char * | 107 | const char * |
109 | hstrerror(err) | 108 | hstrerror(int err) |
110 | int err; | ||
111 | { | 109 | { |
112 | if (err < 0) | 110 | if (err < 0) |
113 | return ("Resolver internal error"); | 111 | return ("Resolver internal error"); |
diff --git a/src/lib/libc/net/htonl.c b/src/lib/libc/net/htonl.c index 73b7432731..f104e190a2 100644 --- a/src/lib/libc/net/htonl.c +++ b/src/lib/libc/net/htonl.c | |||
@@ -4,7 +4,7 @@ | |||
4 | */ | 4 | */ |
5 | 5 | ||
6 | #if defined(LIBC_SCCS) && !defined(lint) | 6 | #if defined(LIBC_SCCS) && !defined(lint) |
7 | static char *rcsid = "$OpenBSD: htonl.c,v 1.4 1996/12/12 03:19:55 tholo Exp $"; | 7 | static char *rcsid = "$OpenBSD: htonl.c,v 1.5 2005/03/25 13:24:12 otto Exp $"; |
8 | #endif /* LIBC_SCCS and not lint */ | 8 | #endif /* LIBC_SCCS and not lint */ |
9 | 9 | ||
10 | #include <sys/types.h> | 10 | #include <sys/types.h> |
@@ -13,8 +13,7 @@ static char *rcsid = "$OpenBSD: htonl.c,v 1.4 1996/12/12 03:19:55 tholo Exp $"; | |||
13 | #undef htonl | 13 | #undef htonl |
14 | 14 | ||
15 | u_int32_t | 15 | u_int32_t |
16 | htonl(x) | 16 | htonl(u_int32_t x) |
17 | u_int32_t x; | ||
18 | { | 17 | { |
19 | #if BYTE_ORDER == LITTLE_ENDIAN | 18 | #if BYTE_ORDER == LITTLE_ENDIAN |
20 | u_char *s = (u_char *)&x; | 19 | u_char *s = (u_char *)&x; |
diff --git a/src/lib/libc/net/inet_addr.c b/src/lib/libc/net/inet_addr.c index 716dcb6f80..b55983fd81 100644 --- a/src/lib/libc/net/inet_addr.c +++ b/src/lib/libc/net/inet_addr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: inet_addr.c,v 1.7 2003/06/02 20:18:35 millert Exp $ */ | 1 | /* $OpenBSD: inet_addr.c,v 1.8 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * ++Copyright++ 1983, 1990, 1993 | 4 | * ++Copyright++ 1983, 1990, 1993 |
@@ -56,7 +56,7 @@ | |||
56 | static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93"; | 56 | static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93"; |
57 | static char rcsid[] = "$From: inet_addr.c,v 8.5 1996/08/05 08:31:35 vixie Exp $"; | 57 | static char rcsid[] = "$From: inet_addr.c,v 8.5 1996/08/05 08:31:35 vixie Exp $"; |
58 | #else | 58 | #else |
59 | static char rcsid[] = "$OpenBSD: inet_addr.c,v 1.7 2003/06/02 20:18:35 millert Exp $"; | 59 | static char rcsid[] = "$OpenBSD: inet_addr.c,v 1.8 2005/03/25 13:24:12 otto Exp $"; |
60 | #endif | 60 | #endif |
61 | #endif /* LIBC_SCCS and not lint */ | 61 | #endif /* LIBC_SCCS and not lint */ |
62 | 62 | ||
@@ -71,8 +71,7 @@ static char rcsid[] = "$OpenBSD: inet_addr.c,v 1.7 2003/06/02 20:18:35 millert E | |||
71 | * The value returned is in network order. | 71 | * The value returned is in network order. |
72 | */ | 72 | */ |
73 | in_addr_t | 73 | in_addr_t |
74 | inet_addr(cp) | 74 | inet_addr(const char *cp) |
75 | register const char *cp; | ||
76 | { | 75 | { |
77 | struct in_addr val; | 76 | struct in_addr val; |
78 | 77 | ||
@@ -89,15 +88,13 @@ inet_addr(cp) | |||
89 | * cannot distinguish between failure and a local broadcast address. | 88 | * cannot distinguish between failure and a local broadcast address. |
90 | */ | 89 | */ |
91 | int | 90 | int |
92 | inet_aton(cp, addr) | 91 | inet_aton(const char *cp, struct in_addr *addr) |
93 | register const char *cp; | ||
94 | struct in_addr *addr; | ||
95 | { | 92 | { |
96 | register in_addr_t val; | 93 | in_addr_t val; |
97 | register int base, n; | 94 | int base, n; |
98 | register char c; | 95 | char c; |
99 | u_int parts[4]; | 96 | u_int parts[4]; |
100 | register u_int *pp = parts; | 97 | u_int *pp = parts; |
101 | 98 | ||
102 | c = *cp; | 99 | c = *cp; |
103 | for (;;) { | 100 | for (;;) { |
diff --git a/src/lib/libc/net/inet_lnaof.c b/src/lib/libc/net/inet_lnaof.c index c1e9780cda..110828b2f6 100644 --- a/src/lib/libc/net/inet_lnaof.c +++ b/src/lib/libc/net/inet_lnaof.c | |||
@@ -28,7 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #if defined(LIBC_SCCS) && !defined(lint) | 30 | #if defined(LIBC_SCCS) && !defined(lint) |
31 | static char rcsid[] = "$OpenBSD: inet_lnaof.c,v 1.4 2003/06/02 20:18:35 millert Exp $"; | 31 | static char rcsid[] = "$OpenBSD: inet_lnaof.c,v 1.5 2005/03/25 13:24:12 otto Exp $"; |
32 | #endif /* LIBC_SCCS and not lint */ | 32 | #endif /* LIBC_SCCS and not lint */ |
33 | 33 | ||
34 | #include <sys/param.h> | 34 | #include <sys/param.h> |
@@ -41,10 +41,9 @@ static char rcsid[] = "$OpenBSD: inet_lnaof.c,v 1.4 2003/06/02 20:18:35 millert | |||
41 | * number formats. | 41 | * number formats. |
42 | */ | 42 | */ |
43 | in_addr_t | 43 | in_addr_t |
44 | inet_lnaof(in) | 44 | inet_lnaof(struct in_addr in) |
45 | struct in_addr in; | ||
46 | { | 45 | { |
47 | register in_addr_t i = ntohl(in.s_addr); | 46 | in_addr_t i = ntohl(in.s_addr); |
48 | 47 | ||
49 | if (IN_CLASSA(i)) | 48 | if (IN_CLASSA(i)) |
50 | return ((i)&IN_CLASSA_HOST); | 49 | return ((i)&IN_CLASSA_HOST); |
diff --git a/src/lib/libc/net/inet_makeaddr.c b/src/lib/libc/net/inet_makeaddr.c index a6b59707fa..9a15da8fec 100644 --- a/src/lib/libc/net/inet_makeaddr.c +++ b/src/lib/libc/net/inet_makeaddr.c | |||
@@ -28,7 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #if defined(LIBC_SCCS) && !defined(lint) | 30 | #if defined(LIBC_SCCS) && !defined(lint) |
31 | static char rcsid[] = "$OpenBSD: inet_makeaddr.c,v 1.4 2003/06/02 20:18:35 millert Exp $"; | 31 | static char rcsid[] = "$OpenBSD: inet_makeaddr.c,v 1.5 2005/03/25 13:24:12 otto Exp $"; |
32 | #endif /* LIBC_SCCS and not lint */ | 32 | #endif /* LIBC_SCCS and not lint */ |
33 | 33 | ||
34 | #include <sys/param.h> | 34 | #include <sys/param.h> |
@@ -40,8 +40,7 @@ static char rcsid[] = "$OpenBSD: inet_makeaddr.c,v 1.4 2003/06/02 20:18:35 mille | |||
40 | * building addresses stored in the ifnet structure. | 40 | * building addresses stored in the ifnet structure. |
41 | */ | 41 | */ |
42 | struct in_addr | 42 | struct in_addr |
43 | inet_makeaddr(net, host) | 43 | inet_makeaddr(in_addr_t net, in_addr_t host) |
44 | in_addr_t net, host; | ||
45 | { | 44 | { |
46 | in_addr_t addr; | 45 | in_addr_t addr; |
47 | 46 | ||
diff --git a/src/lib/libc/net/inet_net_ntop.c b/src/lib/libc/net/inet_net_ntop.c index 2b7de0cec3..38978f3ccf 100644 --- a/src/lib/libc/net/inet_net_ntop.c +++ b/src/lib/libc/net/inet_net_ntop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: inet_net_ntop.c,v 1.4 2004/09/15 19:01:28 deraadt Exp $ */ | 1 | /* $OpenBSD: inet_net_ntop.c,v 1.5 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1996 by Internet Software Consortium. | 4 | * Copyright (c) 1996 by Internet Software Consortium. |
@@ -21,7 +21,7 @@ | |||
21 | #if 0 | 21 | #if 0 |
22 | static const char rcsid[] = "$From: inet_net_ntop.c,v 8.2 1996/08/08 06:54:44 vixie Exp $"; | 22 | static const char rcsid[] = "$From: inet_net_ntop.c,v 8.2 1996/08/08 06:54:44 vixie Exp $"; |
23 | #else | 23 | #else |
24 | static const char rcsid[] = "$OpenBSD: inet_net_ntop.c,v 1.4 2004/09/15 19:01:28 deraadt Exp $"; | 24 | static const char rcsid[] = "$OpenBSD: inet_net_ntop.c,v 1.5 2005/03/25 13:24:12 otto Exp $"; |
25 | #endif | 25 | #endif |
26 | #endif | 26 | #endif |
27 | 27 | ||
@@ -48,12 +48,7 @@ static char *inet_net_ntop_ipv4(const u_char *, int, char *, size_t); | |||
48 | * Paul Vixie (ISC), July 1996 | 48 | * Paul Vixie (ISC), July 1996 |
49 | */ | 49 | */ |
50 | char * | 50 | char * |
51 | inet_net_ntop(af, src, bits, dst, size) | 51 | inet_net_ntop(int af, const void *src, int bits, char *dst, size_t size) |
52 | int af; | ||
53 | const void *src; | ||
54 | int bits; | ||
55 | char *dst; | ||
56 | size_t size; | ||
57 | { | 52 | { |
58 | switch (af) { | 53 | switch (af) { |
59 | case AF_INET: | 54 | case AF_INET: |
@@ -78,11 +73,7 @@ inet_net_ntop(af, src, bits, dst, size) | |||
78 | * Paul Vixie (ISC), July 1996 | 73 | * Paul Vixie (ISC), July 1996 |
79 | */ | 74 | */ |
80 | static char * | 75 | static char * |
81 | inet_net_ntop_ipv4(src, bits, dst, size) | 76 | inet_net_ntop_ipv4(const u_char *src, int bits, char *dst, size_t size) |
82 | const u_char *src; | ||
83 | int bits; | ||
84 | char *dst; | ||
85 | size_t size; | ||
86 | { | 77 | { |
87 | char *odst = dst; | 78 | char *odst = dst; |
88 | u_int m; | 79 | u_int m; |
diff --git a/src/lib/libc/net/inet_net_pton.c b/src/lib/libc/net/inet_net_pton.c index 3c72efac6b..e544ca7e28 100644 --- a/src/lib/libc/net/inet_net_pton.c +++ b/src/lib/libc/net/inet_net_pton.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: inet_net_pton.c,v 1.3 2003/04/25 19:40:25 henning Exp $ */ | 1 | /* $OpenBSD: inet_net_pton.c,v 1.4 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1996 by Internet Software Consortium. | 4 | * Copyright (c) 1996 by Internet Software Consortium. |
@@ -21,7 +21,7 @@ | |||
21 | #if 0 | 21 | #if 0 |
22 | static const char rcsid[] = "$From: inet_net_pton.c,v 8.3 1996/11/11 06:36:52 vixie Exp $"; | 22 | static const char rcsid[] = "$From: inet_net_pton.c,v 8.3 1996/11/11 06:36:52 vixie Exp $"; |
23 | #else | 23 | #else |
24 | static const char rcsid[] = "$OpenBSD: inet_net_pton.c,v 1.3 2003/04/25 19:40:25 henning Exp $"; | 24 | static const char rcsid[] = "$OpenBSD: inet_net_pton.c,v 1.4 2005/03/25 13:24:12 otto Exp $"; |
25 | #endif | 25 | #endif |
26 | #endif | 26 | #endif |
27 | 27 | ||
@@ -53,11 +53,7 @@ static int inet_net_pton_ipv4(const char *, u_char *, size_t); | |||
53 | * Paul Vixie (ISC), June 1996 | 53 | * Paul Vixie (ISC), June 1996 |
54 | */ | 54 | */ |
55 | int | 55 | int |
56 | inet_net_pton(af, src, dst, size) | 56 | inet_net_pton(int af, const char *src, void *dst, size_t size) |
57 | int af; | ||
58 | const char *src; | ||
59 | void *dst; | ||
60 | size_t size; | ||
61 | { | 57 | { |
62 | switch (af) { | 58 | switch (af) { |
63 | case AF_INET: | 59 | case AF_INET: |
@@ -85,10 +81,7 @@ inet_net_pton(af, src, dst, size) | |||
85 | * Paul Vixie (ISC), June 1996 | 81 | * Paul Vixie (ISC), June 1996 |
86 | */ | 82 | */ |
87 | static int | 83 | static int |
88 | inet_net_pton_ipv4(src, dst, size) | 84 | inet_net_pton_ipv4(const char *src, u_char *dst, size_t size) |
89 | const char *src; | ||
90 | u_char *dst; | ||
91 | size_t size; | ||
92 | { | 85 | { |
93 | static const char | 86 | static const char |
94 | xdigits[] = "0123456789abcdef", | 87 | xdigits[] = "0123456789abcdef", |
diff --git a/src/lib/libc/net/inet_neta.c b/src/lib/libc/net/inet_neta.c index c13e084d2d..c9bb3c0464 100644 --- a/src/lib/libc/net/inet_neta.c +++ b/src/lib/libc/net/inet_neta.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: inet_neta.c,v 1.5 2005/03/02 12:27:26 millert Exp $ */ | 1 | /* $OpenBSD: inet_neta.c,v 1.6 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1996 by Internet Software Consortium. | 4 | * Copyright (c) 1996 by Internet Software Consortium. |
@@ -18,7 +18,7 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #if defined(LIBC_SCCS) && !defined(lint) | 20 | #if defined(LIBC_SCCS) && !defined(lint) |
21 | static const char rcsid[] = "$OpenBSD: inet_neta.c,v 1.5 2005/03/02 12:27:26 millert Exp $"; | 21 | static const char rcsid[] = "$OpenBSD: inet_neta.c,v 1.6 2005/03/25 13:24:12 otto Exp $"; |
22 | #endif | 22 | #endif |
23 | 23 | ||
24 | #include <sys/types.h> | 24 | #include <sys/types.h> |
@@ -42,10 +42,7 @@ static const char rcsid[] = "$OpenBSD: inet_neta.c,v 1.5 2005/03/02 12:27:26 mil | |||
42 | * Paul Vixie (ISC), July 1996 | 42 | * Paul Vixie (ISC), July 1996 |
43 | */ | 43 | */ |
44 | char * | 44 | char * |
45 | inet_neta(src, dst, size) | 45 | inet_neta(in_addr_t src, char *dst, size_t size) |
46 | in_addr_t src; | ||
47 | char *dst; | ||
48 | size_t size; | ||
49 | { | 46 | { |
50 | char *odst = dst; | 47 | char *odst = dst; |
51 | char *ep; | 48 | char *ep; |
diff --git a/src/lib/libc/net/inet_netof.c b/src/lib/libc/net/inet_netof.c index 58be2d05cd..83f346c5f5 100644 --- a/src/lib/libc/net/inet_netof.c +++ b/src/lib/libc/net/inet_netof.c | |||
@@ -28,7 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #if defined(LIBC_SCCS) && !defined(lint) | 30 | #if defined(LIBC_SCCS) && !defined(lint) |
31 | static char rcsid[] = "$OpenBSD: inet_netof.c,v 1.4 2003/06/02 20:18:35 millert Exp $"; | 31 | static char rcsid[] = "$OpenBSD: inet_netof.c,v 1.5 2005/03/25 13:24:12 otto Exp $"; |
32 | #endif /* LIBC_SCCS and not lint */ | 32 | #endif /* LIBC_SCCS and not lint */ |
33 | 33 | ||
34 | #include <sys/param.h> | 34 | #include <sys/param.h> |
@@ -40,10 +40,9 @@ static char rcsid[] = "$OpenBSD: inet_netof.c,v 1.4 2003/06/02 20:18:35 millert | |||
40 | * address; handles class a/b/c network #'s. | 40 | * address; handles class a/b/c network #'s. |
41 | */ | 41 | */ |
42 | in_addr_t | 42 | in_addr_t |
43 | inet_netof(in) | 43 | inet_netof(struct in_addr in) |
44 | struct in_addr in; | ||
45 | { | 44 | { |
46 | register in_addr_t i = ntohl(in.s_addr); | 45 | in_addr_t i = ntohl(in.s_addr); |
47 | 46 | ||
48 | if (IN_CLASSA(i)) | 47 | if (IN_CLASSA(i)) |
49 | return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT); | 48 | return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT); |
diff --git a/src/lib/libc/net/inet_network.c b/src/lib/libc/net/inet_network.c index 5e36f78069..7a7956ec83 100644 --- a/src/lib/libc/net/inet_network.c +++ b/src/lib/libc/net/inet_network.c | |||
@@ -28,7 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #if defined(LIBC_SCCS) && !defined(lint) | 30 | #if defined(LIBC_SCCS) && !defined(lint) |
31 | static char rcsid[] = "$OpenBSD: inet_network.c,v 1.8 2003/06/02 20:18:35 millert Exp $"; | 31 | static char rcsid[] = "$OpenBSD: inet_network.c,v 1.9 2005/03/25 13:24:12 otto Exp $"; |
32 | #endif /* LIBC_SCCS and not lint */ | 32 | #endif /* LIBC_SCCS and not lint */ |
33 | 33 | ||
34 | #include <sys/types.h> | 34 | #include <sys/types.h> |
@@ -42,13 +42,12 @@ static char rcsid[] = "$OpenBSD: inet_network.c,v 1.8 2003/06/02 20:18:35 miller | |||
42 | * network numbers. | 42 | * network numbers. |
43 | */ | 43 | */ |
44 | in_addr_t | 44 | in_addr_t |
45 | inet_network(cp) | 45 | inet_network(const char *cp) |
46 | register const char *cp; | ||
47 | { | 46 | { |
48 | register in_addr_t val, base, n; | 47 | in_addr_t val, base, n; |
49 | register char c; | 48 | char c; |
50 | in_addr_t parts[4], *pp = parts; | 49 | in_addr_t parts[4], *pp = parts; |
51 | register int i; | 50 | int i; |
52 | 51 | ||
53 | again: | 52 | again: |
54 | val = 0; base = 10; | 53 | val = 0; base = 10; |
diff --git a/src/lib/libc/net/inet_ntoa.c b/src/lib/libc/net/inet_ntoa.c index bd3fd98b09..0e7fe863f6 100644 --- a/src/lib/libc/net/inet_ntoa.c +++ b/src/lib/libc/net/inet_ntoa.c | |||
@@ -28,7 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #if defined(LIBC_SCCS) && !defined(lint) | 30 | #if defined(LIBC_SCCS) && !defined(lint) |
31 | static char rcsid[] = "$OpenBSD: inet_ntoa.c,v 1.4 2003/06/02 20:18:35 millert Exp $"; | 31 | static char rcsid[] = "$OpenBSD: inet_ntoa.c,v 1.5 2005/03/25 13:24:12 otto Exp $"; |
32 | #endif /* LIBC_SCCS and not lint */ | 32 | #endif /* LIBC_SCCS and not lint */ |
33 | 33 | ||
34 | /* | 34 | /* |
@@ -41,11 +41,10 @@ static char rcsid[] = "$OpenBSD: inet_ntoa.c,v 1.4 2003/06/02 20:18:35 millert E | |||
41 | #include <stdio.h> | 41 | #include <stdio.h> |
42 | 42 | ||
43 | char * | 43 | char * |
44 | inet_ntoa(in) | 44 | inet_ntoa(struct in_addr in) |
45 | struct in_addr in; | ||
46 | { | 45 | { |
47 | static char b[18]; | 46 | static char b[18]; |
48 | register char *p; | 47 | char *p; |
49 | 48 | ||
50 | p = (char *)∈ | 49 | p = (char *)∈ |
51 | #define UC(b) (((int)b)&0xff) | 50 | #define UC(b) (((int)b)&0xff) |
diff --git a/src/lib/libc/net/inet_ntop.c b/src/lib/libc/net/inet_ntop.c index adce61c1d4..ec5c12983a 100644 --- a/src/lib/libc/net/inet_ntop.c +++ b/src/lib/libc/net/inet_ntop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: inet_ntop.c,v 1.5 2002/08/23 16:27:31 itojun Exp $ */ | 1 | /* $OpenBSD: inet_ntop.c,v 1.6 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* Copyright (c) 1996 by Internet Software Consortium. | 3 | /* Copyright (c) 1996 by Internet Software Consortium. |
4 | * | 4 | * |
@@ -20,7 +20,7 @@ | |||
20 | #if 0 | 20 | #if 0 |
21 | static char rcsid[] = "$From: inet_ntop.c,v 8.7 1996/08/05 08:41:18 vixie Exp $"; | 21 | static char rcsid[] = "$From: inet_ntop.c,v 8.7 1996/08/05 08:41:18 vixie Exp $"; |
22 | #else | 22 | #else |
23 | static char rcsid[] = "$OpenBSD: inet_ntop.c,v 1.5 2002/08/23 16:27:31 itojun Exp $"; | 23 | static char rcsid[] = "$OpenBSD: inet_ntop.c,v 1.6 2005/03/25 13:24:12 otto Exp $"; |
24 | #endif | 24 | #endif |
25 | #endif /* LIBC_SCCS and not lint */ | 25 | #endif /* LIBC_SCCS and not lint */ |
26 | 26 | ||
@@ -51,11 +51,7 @@ static const char *inet_ntop6(const u_char *src, char *dst, size_t size); | |||
51 | * Paul Vixie, 1996. | 51 | * Paul Vixie, 1996. |
52 | */ | 52 | */ |
53 | const char * | 53 | const char * |
54 | inet_ntop(af, src, dst, size) | 54 | inet_ntop(int af, const void *src, char *dst, size_t size) |
55 | int af; | ||
56 | const void *src; | ||
57 | char *dst; | ||
58 | size_t size; | ||
59 | { | 55 | { |
60 | switch (af) { | 56 | switch (af) { |
61 | case AF_INET: | 57 | case AF_INET: |
@@ -81,10 +77,7 @@ inet_ntop(af, src, dst, size) | |||
81 | * Paul Vixie, 1996. | 77 | * Paul Vixie, 1996. |
82 | */ | 78 | */ |
83 | static const char * | 79 | static const char * |
84 | inet_ntop4(src, dst, size) | 80 | inet_ntop4(const u_char *src, char *dst, size_t size) |
85 | const u_char *src; | ||
86 | char *dst; | ||
87 | size_t size; | ||
88 | { | 81 | { |
89 | static const char fmt[] = "%u.%u.%u.%u"; | 82 | static const char fmt[] = "%u.%u.%u.%u"; |
90 | char tmp[sizeof "255.255.255.255"]; | 83 | char tmp[sizeof "255.255.255.255"]; |
@@ -106,10 +99,7 @@ inet_ntop4(src, dst, size) | |||
106 | * Paul Vixie, 1996. | 99 | * Paul Vixie, 1996. |
107 | */ | 100 | */ |
108 | static const char * | 101 | static const char * |
109 | inet_ntop6(src, dst, size) | 102 | inet_ntop6(const u_char *src, char *dst, size_t size) |
110 | const u_char *src; | ||
111 | char *dst; | ||
112 | size_t size; | ||
113 | { | 103 | { |
114 | /* | 104 | /* |
115 | * Note that int32_t and int16_t need only be "at least" large enough | 105 | * Note that int32_t and int16_t need only be "at least" large enough |
diff --git a/src/lib/libc/net/inet_pton.c b/src/lib/libc/net/inet_pton.c index b04ef05c31..ec158d4599 100644 --- a/src/lib/libc/net/inet_pton.c +++ b/src/lib/libc/net/inet_pton.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: inet_pton.c,v 1.4 2002/02/16 21:27:23 millert Exp $ */ | 1 | /* $OpenBSD: inet_pton.c,v 1.5 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* Copyright (c) 1996 by Internet Software Consortium. | 3 | /* Copyright (c) 1996 by Internet Software Consortium. |
4 | * | 4 | * |
@@ -20,7 +20,7 @@ | |||
20 | #if 0 | 20 | #if 0 |
21 | static char rcsid[] = "$From: inet_pton.c,v 8.7 1996/08/05 08:31:35 vixie Exp $"; | 21 | static char rcsid[] = "$From: inet_pton.c,v 8.7 1996/08/05 08:31:35 vixie Exp $"; |
22 | #else | 22 | #else |
23 | static char rcsid[] = "$OpenBSD: inet_pton.c,v 1.4 2002/02/16 21:27:23 millert Exp $"; | 23 | static char rcsid[] = "$OpenBSD: inet_pton.c,v 1.5 2005/03/25 13:24:12 otto Exp $"; |
24 | #endif | 24 | #endif |
25 | #endif /* LIBC_SCCS and not lint */ | 25 | #endif /* LIBC_SCCS and not lint */ |
26 | 26 | ||
@@ -53,10 +53,7 @@ static int inet_pton6(const char *src, u_char *dst); | |||
53 | * Paul Vixie, 1996. | 53 | * Paul Vixie, 1996. |
54 | */ | 54 | */ |
55 | int | 55 | int |
56 | inet_pton(af, src, dst) | 56 | inet_pton(int af, const char *src, void *dst) |
57 | int af; | ||
58 | const char *src; | ||
59 | void *dst; | ||
60 | { | 57 | { |
61 | switch (af) { | 58 | switch (af) { |
62 | case AF_INET: | 59 | case AF_INET: |
@@ -81,9 +78,7 @@ inet_pton(af, src, dst) | |||
81 | * Paul Vixie, 1996. | 78 | * Paul Vixie, 1996. |
82 | */ | 79 | */ |
83 | static int | 80 | static int |
84 | inet_pton4(src, dst) | 81 | inet_pton4(const char *src, u_char *dst) |
85 | const char *src; | ||
86 | u_char *dst; | ||
87 | { | 82 | { |
88 | static const char digits[] = "0123456789"; | 83 | static const char digits[] = "0123456789"; |
89 | int saw_digit, octets, ch; | 84 | int saw_digit, octets, ch; |
@@ -135,9 +130,7 @@ inet_pton4(src, dst) | |||
135 | * Paul Vixie, 1996. | 130 | * Paul Vixie, 1996. |
136 | */ | 131 | */ |
137 | static int | 132 | static int |
138 | inet_pton6(src, dst) | 133 | inet_pton6(const char *src, u_char *dst) |
139 | const char *src; | ||
140 | u_char *dst; | ||
141 | { | 134 | { |
142 | static const char xdigits_l[] = "0123456789abcdef", | 135 | static const char xdigits_l[] = "0123456789abcdef", |
143 | xdigits_u[] = "0123456789ABCDEF"; | 136 | xdigits_u[] = "0123456789ABCDEF"; |
diff --git a/src/lib/libc/net/ip6opt.c b/src/lib/libc/net/ip6opt.c index cbd49f0c22..565c0ed369 100644 --- a/src/lib/libc/net/ip6opt.c +++ b/src/lib/libc/net/ip6opt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ip6opt.c,v 1.1 1999/12/11 08:09:11 itojun Exp $ */ | 1 | /* $OpenBSD: ip6opt.c,v 1.2 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. | 4 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. |
@@ -52,8 +52,7 @@ static void inet6_insert_padopt(u_char *p, int len); | |||
52 | * byte, the length byte, and the option data. | 52 | * byte, the length byte, and the option data. |
53 | */ | 53 | */ |
54 | int | 54 | int |
55 | inet6_option_space(nbytes) | 55 | inet6_option_space(int nbytes) |
56 | int nbytes; | ||
57 | { | 56 | { |
58 | nbytes += 2; /* we need space for nxt-hdr and length fields */ | 57 | nbytes += 2; /* we need space for nxt-hdr and length fields */ |
59 | return(CMSG_SPACE((nbytes + 7) & ~7)); | 58 | return(CMSG_SPACE((nbytes + 7) & ~7)); |
@@ -65,12 +64,9 @@ inet6_option_space(nbytes) | |||
65 | * success or -1 on an error. | 64 | * success or -1 on an error. |
66 | */ | 65 | */ |
67 | int | 66 | int |
68 | inet6_option_init(bp, cmsgp, type) | 67 | inet6_option_init(void *bp, struct cmsghdr **cmsgp, int type) |
69 | void *bp; | ||
70 | struct cmsghdr **cmsgp; | ||
71 | int type; | ||
72 | { | 68 | { |
73 | register struct cmsghdr *ch = (struct cmsghdr *)bp; | 69 | struct cmsghdr *ch = (struct cmsghdr *)bp; |
74 | 70 | ||
75 | /* argument validation */ | 71 | /* argument validation */ |
76 | if (type != IPV6_HOPOPTS && type != IPV6_DSTOPTS) | 72 | if (type != IPV6_HOPOPTS && type != IPV6_DSTOPTS) |
@@ -95,14 +91,11 @@ inet6_option_init(bp, cmsgp, type) | |||
95 | * earlier. It must have a value between 0 and 7, inclusive. | 91 | * earlier. It must have a value between 0 and 7, inclusive. |
96 | */ | 92 | */ |
97 | int | 93 | int |
98 | inet6_option_append(cmsg, typep, multx, plusy) | 94 | inet6_option_append(struct cmsghdr *cmsg, const u_int8_t *typep, int multx, |
99 | struct cmsghdr *cmsg; | 95 | int plusy) |
100 | const u_int8_t *typep; | ||
101 | int multx; | ||
102 | int plusy; | ||
103 | { | 96 | { |
104 | int padlen, optlen, off; | 97 | int padlen, optlen, off; |
105 | register u_char *bp = (u_char *)cmsg + cmsg->cmsg_len; | 98 | u_char *bp = (u_char *)cmsg + cmsg->cmsg_len; |
106 | struct ip6_ext *eh = (struct ip6_ext *)CMSG_DATA(cmsg); | 99 | struct ip6_ext *eh = (struct ip6_ext *)CMSG_DATA(cmsg); |
107 | 100 | ||
108 | /* argument validation */ | 101 | /* argument validation */ |
@@ -170,14 +163,10 @@ inet6_option_append(cmsg, typep, multx, plusy) | |||
170 | * | 163 | * |
171 | */ | 164 | */ |
172 | u_int8_t * | 165 | u_int8_t * |
173 | inet6_option_alloc(cmsg, datalen, multx, plusy) | 166 | inet6_option_alloc(struct cmsghdr *cmsg, int datalen, int multx, int plusy) |
174 | struct cmsghdr *cmsg; | ||
175 | int datalen; | ||
176 | int multx; | ||
177 | int plusy; | ||
178 | { | 167 | { |
179 | int padlen, off; | 168 | int padlen, off; |
180 | register u_int8_t *bp = (u_char *)cmsg + cmsg->cmsg_len; | 169 | u_int8_t *bp = (u_char *)cmsg + cmsg->cmsg_len; |
181 | u_int8_t *retval; | 170 | u_int8_t *retval; |
182 | struct ip6_ext *eh = (struct ip6_ext *)CMSG_DATA(cmsg); | 171 | struct ip6_ext *eh = (struct ip6_ext *)CMSG_DATA(cmsg); |
183 | 172 | ||
@@ -237,9 +226,7 @@ inet6_option_alloc(cmsg, datalen, multx, plusy) | |||
237 | * (RFC 2292, 6.3.5) | 226 | * (RFC 2292, 6.3.5) |
238 | */ | 227 | */ |
239 | int | 228 | int |
240 | inet6_option_next(cmsg, tptrp) | 229 | inet6_option_next(const struct cmsghdr *cmsg, u_int8_t **tptrp) |
241 | const struct cmsghdr *cmsg; | ||
242 | u_int8_t **tptrp; | ||
243 | { | 230 | { |
244 | struct ip6_ext *ip6e; | 231 | struct ip6_ext *ip6e; |
245 | int hdrlen, optlen; | 232 | int hdrlen, optlen; |
@@ -295,10 +282,7 @@ inet6_option_next(cmsg, tptrp) | |||
295 | * it's a typo. The variable should be type of u_int8_t **. | 282 | * it's a typo. The variable should be type of u_int8_t **. |
296 | */ | 283 | */ |
297 | int | 284 | int |
298 | inet6_option_find(cmsg, tptrp, type) | 285 | inet6_option_find(const struct cmsghdr *cmsg, u_int8_t **tptrp, int type) |
299 | const struct cmsghdr *cmsg; | ||
300 | u_int8_t **tptrp; | ||
301 | int type; | ||
302 | { | 286 | { |
303 | struct ip6_ext *ip6e; | 287 | struct ip6_ext *ip6e; |
304 | int hdrlen, optlen; | 288 | int hdrlen, optlen; |
@@ -351,8 +335,7 @@ inet6_option_find(cmsg, tptrp, type) | |||
351 | * calculated length and the limitation of the buffer. | 335 | * calculated length and the limitation of the buffer. |
352 | */ | 336 | */ |
353 | static int | 337 | static int |
354 | ip6optlen(opt, lim) | 338 | ip6optlen(u_int8_t *opt, u_int8_t *lim) |
355 | u_int8_t *opt, *lim; | ||
356 | { | 339 | { |
357 | int optlen; | 340 | int optlen; |
358 | 341 | ||
diff --git a/src/lib/libc/net/ipx_addr.c b/src/lib/libc/net/ipx_addr.c index 371ac7c917..c7f8306128 100644 --- a/src/lib/libc/net/ipx_addr.c +++ b/src/lib/libc/net/ipx_addr.c | |||
@@ -33,7 +33,7 @@ | |||
33 | */ | 33 | */ |
34 | 34 | ||
35 | #if defined(LIBC_SCCS) && !defined(lint) | 35 | #if defined(LIBC_SCCS) && !defined(lint) |
36 | static char rcsid[] = "$OpenBSD: ipx_addr.c,v 1.6 2003/06/02 20:18:35 millert Exp $"; | 36 | static char rcsid[] = "$OpenBSD: ipx_addr.c,v 1.7 2005/03/25 13:24:12 otto Exp $"; |
37 | #endif /* LIBC_SCCS and not lint */ | 37 | #endif /* LIBC_SCCS and not lint */ |
38 | 38 | ||
39 | #include <sys/param.h> | 39 | #include <sys/param.h> |
@@ -43,11 +43,11 @@ static char rcsid[] = "$OpenBSD: ipx_addr.c,v 1.6 2003/06/02 20:18:35 millert Ex | |||
43 | 43 | ||
44 | static struct ipx_addr addr, zero_addr; | 44 | static struct ipx_addr addr, zero_addr; |
45 | 45 | ||
46 | static void Field(), cvtbase(); | 46 | static void Field(char *, u_char *, int); |
47 | static void cvtbase(long, int, int *, int, unsigned char *, int); | ||
47 | 48 | ||
48 | struct ipx_addr | 49 | struct ipx_addr |
49 | ipx_addr(name) | 50 | ipx_addr(const char *name) |
50 | const char *name; | ||
51 | { | 51 | { |
52 | char separator; | 52 | char separator; |
53 | char *hostname, *socketname, *cp; | 53 | char *hostname, *socketname, *cp; |
@@ -92,12 +92,9 @@ ipx_addr(name) | |||
92 | } | 92 | } |
93 | 93 | ||
94 | static void | 94 | static void |
95 | Field(buf, out, len) | 95 | Field(char *buf, u_char *out, int len) |
96 | char *buf; | ||
97 | u_char *out; | ||
98 | int len; | ||
99 | { | 96 | { |
100 | register char *bp = buf; | 97 | char *bp = buf; |
101 | int i, ibase, base16 = 0, base10 = 0, clen = 0; | 98 | int i, ibase, base16 = 0, base10 = 0, clen = 0; |
102 | int hb[6], *hp; | 99 | int hb[6], *hp; |
103 | char *fmt; | 100 | char *fmt; |
@@ -196,13 +193,8 @@ Field(buf, out, len) | |||
196 | } | 193 | } |
197 | 194 | ||
198 | static void | 195 | static void |
199 | cvtbase(oldbase,newbase,input,inlen,result,reslen) | 196 | cvtbase(long oldbase, int newbase, int *input, int inlen, |
200 | long oldbase; | 197 | unsigned char *result, int reslen) |
201 | int newbase; | ||
202 | int input[]; | ||
203 | int inlen; | ||
204 | unsigned char result[]; | ||
205 | int reslen; | ||
206 | { | 198 | { |
207 | int d, e; | 199 | int d, e; |
208 | long sum; | 200 | long sum; |
diff --git a/src/lib/libc/net/linkaddr.c b/src/lib/libc/net/linkaddr.c index ee45ff767d..fcb0164ca4 100644 --- a/src/lib/libc/net/linkaddr.c +++ b/src/lib/libc/net/linkaddr.c | |||
@@ -28,7 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #if defined(LIBC_SCCS) && !defined(lint) | 30 | #if defined(LIBC_SCCS) && !defined(lint) |
31 | static char rcsid[] = "$OpenBSD: linkaddr.c,v 1.3 2003/06/02 20:18:35 millert Exp $"; | 31 | static char rcsid[] = "$OpenBSD: linkaddr.c,v 1.4 2005/03/25 13:24:12 otto Exp $"; |
32 | #endif /* LIBC_SCCS and not lint */ | 32 | #endif /* LIBC_SCCS and not lint */ |
33 | 33 | ||
34 | #include <sys/types.h> | 34 | #include <sys/types.h> |
@@ -48,13 +48,11 @@ static char rcsid[] = "$OpenBSD: linkaddr.c,v 1.3 2003/06/02 20:18:35 millert Ex | |||
48 | #define LETTER (4*3) | 48 | #define LETTER (4*3) |
49 | 49 | ||
50 | void | 50 | void |
51 | link_addr(addr, sdl) | 51 | link_addr(const char *addr, struct sockaddr_dl *sdl) |
52 | register const char *addr; | ||
53 | register struct sockaddr_dl *sdl; | ||
54 | { | 52 | { |
55 | register char *cp = sdl->sdl_data; | 53 | char *cp = sdl->sdl_data; |
56 | char *cplim = sdl->sdl_len + (char *)sdl; | 54 | char *cplim = sdl->sdl_len + (char *)sdl; |
57 | register int byte = 0, state = NAMING, new; | 55 | int byte = 0, state = NAMING, new; |
58 | 56 | ||
59 | bzero((char *)&sdl->sdl_family, sdl->sdl_len - 1); | 57 | bzero((char *)&sdl->sdl_family, sdl->sdl_len - 1); |
60 | sdl->sdl_family = AF_LINK; | 58 | sdl->sdl_family = AF_LINK; |
@@ -119,13 +117,12 @@ link_addr(addr, sdl) | |||
119 | static char hexlist[] = "0123456789abcdef"; | 117 | static char hexlist[] = "0123456789abcdef"; |
120 | 118 | ||
121 | char * | 119 | char * |
122 | link_ntoa(sdl) | 120 | link_ntoa(const struct sockaddr_dl *sdl) |
123 | register const struct sockaddr_dl *sdl; | ||
124 | { | 121 | { |
125 | static char obuf[64]; | 122 | static char obuf[64]; |
126 | register char *out = obuf; | 123 | char *out = obuf; |
127 | register int i; | 124 | int i; |
128 | register u_char *in = (u_char *)LLADDR(sdl); | 125 | u_char *in = (u_char *)LLADDR(sdl); |
129 | u_char *inlim = in + sdl->sdl_alen; | 126 | u_char *inlim = in + sdl->sdl_alen; |
130 | int firsttime = 1; | 127 | int firsttime = 1; |
131 | 128 | ||
diff --git a/src/lib/libc/net/net_addrcmp.c b/src/lib/libc/net/net_addrcmp.c index b5732ec99a..8f8f694f4c 100644 --- a/src/lib/libc/net/net_addrcmp.c +++ b/src/lib/libc/net/net_addrcmp.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: net_addrcmp.c,v 1.8 2004/10/01 04:08:45 jsg Exp $ */ | 1 | /* $OpenBSD: net_addrcmp.c,v 1.9 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1999 Theo de Raadt | 4 | * Copyright (c) 1999 Theo de Raadt |
@@ -33,9 +33,7 @@ | |||
33 | #include <string.h> | 33 | #include <string.h> |
34 | 34 | ||
35 | int | 35 | int |
36 | net_addrcmp(sa1, sa2) | 36 | net_addrcmp(struct sockaddr *sa1, struct sockaddr *sa2) |
37 | struct sockaddr *sa1; | ||
38 | struct sockaddr *sa2; | ||
39 | { | 37 | { |
40 | 38 | ||
41 | if (sa1->sa_len != sa2->sa_len) | 39 | if (sa1->sa_len != sa2->sa_len) |
diff --git a/src/lib/libc/net/ns_addr.c b/src/lib/libc/net/ns_addr.c index 0f8feda55c..03b14909c5 100644 --- a/src/lib/libc/net/ns_addr.c +++ b/src/lib/libc/net/ns_addr.c | |||
@@ -31,7 +31,7 @@ | |||
31 | */ | 31 | */ |
32 | 32 | ||
33 | #if defined(LIBC_SCCS) && !defined(lint) | 33 | #if defined(LIBC_SCCS) && !defined(lint) |
34 | static char rcsid[] = "$OpenBSD: ns_addr.c,v 1.8 2003/06/02 20:18:35 millert Exp $"; | 34 | static char rcsid[] = "$OpenBSD: ns_addr.c,v 1.9 2005/03/25 13:24:12 otto Exp $"; |
35 | #endif /* LIBC_SCCS and not lint */ | 35 | #endif /* LIBC_SCCS and not lint */ |
36 | 36 | ||
37 | #include <sys/param.h> | 37 | #include <sys/param.h> |
@@ -45,8 +45,7 @@ static void Field(char *, u_int8_t *, int); | |||
45 | static void cvtbase(long, int, int[], int, u_int8_t[], int); | 45 | static void cvtbase(long, int, int[], int, u_int8_t[], int); |
46 | 46 | ||
47 | struct ns_addr | 47 | struct ns_addr |
48 | ns_addr(name) | 48 | ns_addr(const char *name) |
49 | const char *name; | ||
50 | { | 49 | { |
51 | char separator; | 50 | char separator; |
52 | char *hostname, *socketname, *cp; | 51 | char *hostname, *socketname, *cp; |
@@ -91,12 +90,9 @@ ns_addr(name) | |||
91 | } | 90 | } |
92 | 91 | ||
93 | static void | 92 | static void |
94 | Field(buf, out, len) | 93 | Field(char *buf, u_char *out, int len) |
95 | char *buf; | ||
96 | u_char *out; | ||
97 | int len; | ||
98 | { | 94 | { |
99 | register char *bp = buf; | 95 | char *bp = buf; |
100 | int i, ibase, base16 = 0, base10 = 0, clen = 0; | 96 | int i, ibase, base16 = 0, base10 = 0, clen = 0; |
101 | int hb[6], *hp; | 97 | int hb[6], *hp; |
102 | char *fmt; | 98 | char *fmt; |
@@ -195,13 +191,8 @@ Field(buf, out, len) | |||
195 | } | 191 | } |
196 | 192 | ||
197 | static void | 193 | static void |
198 | cvtbase(oldbase,newbase,input,inlen,result,reslen) | 194 | cvtbase(long int oldbase, int newbase, int *input, int inlen, |
199 | long oldbase; | 195 | unsigned char *result, int reslen) |
200 | int newbase; | ||
201 | int input[]; | ||
202 | int inlen; | ||
203 | unsigned char result[]; | ||
204 | int reslen; | ||
205 | { | 196 | { |
206 | int d, e; | 197 | int d, e; |
207 | long sum; | 198 | long sum; |
diff --git a/src/lib/libc/net/nsap_addr.c b/src/lib/libc/net/nsap_addr.c index 22a5f8d66e..58c0d5e493 100644 --- a/src/lib/libc/net/nsap_addr.c +++ b/src/lib/libc/net/nsap_addr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: nsap_addr.c,v 1.4 1997/07/09 01:08:45 millert Exp $ */ | 1 | /* $OpenBSD: nsap_addr.c,v 1.5 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1996 by Internet Software Consortium. | 4 | * Copyright (c) 1996 by Internet Software Consortium. |
@@ -21,7 +21,7 @@ | |||
21 | #if 0 | 21 | #if 0 |
22 | static char rcsid[] = "$From: nsap_addr.c,v 8.3 1996/08/05 08:31:35 vixie Exp $"; | 22 | static char rcsid[] = "$From: nsap_addr.c,v 8.3 1996/08/05 08:31:35 vixie Exp $"; |
23 | #else | 23 | #else |
24 | static char rcsid[] = "$OpenBSD: nsap_addr.c,v 1.4 1997/07/09 01:08:45 millert Exp $"; | 24 | static char rcsid[] = "$OpenBSD: nsap_addr.c,v 1.5 2005/03/25 13:24:12 otto Exp $"; |
25 | #endif | 25 | #endif |
26 | #endif /* LIBC_SCCS and not lint */ | 26 | #endif /* LIBC_SCCS and not lint */ |
27 | 27 | ||
@@ -34,19 +34,15 @@ static char rcsid[] = "$OpenBSD: nsap_addr.c,v 1.4 1997/07/09 01:08:45 millert E | |||
34 | #include <resolv.h> | 34 | #include <resolv.h> |
35 | 35 | ||
36 | static char | 36 | static char |
37 | xtob(c) | 37 | xtob(int c) |
38 | register int c; | ||
39 | { | 38 | { |
40 | return (c - (((c >= '0') && (c <= '9')) ? '0' : '7')); | 39 | return (c - (((c >= '0') && (c <= '9')) ? '0' : '7')); |
41 | } | 40 | } |
42 | 41 | ||
43 | u_int | 42 | u_int |
44 | inet_nsap_addr(ascii, binary, maxlen) | 43 | inet_nsap_addr(const char *ascii, u_char *binary, int maxlen) |
45 | const char *ascii; | ||
46 | u_char *binary; | ||
47 | int maxlen; | ||
48 | { | 44 | { |
49 | register u_char c, nib; | 45 | u_char c, nib; |
50 | u_int len = 0; | 46 | u_int len = 0; |
51 | 47 | ||
52 | while ((c = *ascii++) != '\0' && len < maxlen) { | 48 | while ((c = *ascii++) != '\0' && len < maxlen) { |
@@ -76,12 +72,9 @@ inet_nsap_addr(ascii, binary, maxlen) | |||
76 | } | 72 | } |
77 | 73 | ||
78 | char * | 74 | char * |
79 | inet_nsap_ntoa(binlen, binary, ascii) | 75 | inet_nsap_ntoa(int binlen, const u_char *binary, char *ascii) |
80 | int binlen; | ||
81 | register const u_char *binary; | ||
82 | register char *ascii; | ||
83 | { | 76 | { |
84 | register int nib; | 77 | int nib; |
85 | int i; | 78 | int i; |
86 | static char tmpbuf[255*3]; | 79 | static char tmpbuf[255*3]; |
87 | char *start; | 80 | char *start; |
diff --git a/src/lib/libc/net/ntohl.c b/src/lib/libc/net/ntohl.c index 7d3e227e60..c8b2ca2bb5 100644 --- a/src/lib/libc/net/ntohl.c +++ b/src/lib/libc/net/ntohl.c | |||
@@ -4,7 +4,7 @@ | |||
4 | */ | 4 | */ |
5 | 5 | ||
6 | #if defined(LIBC_SCCS) && !defined(lint) | 6 | #if defined(LIBC_SCCS) && !defined(lint) |
7 | static char *rcsid = "$OpenBSD: ntohl.c,v 1.4 1996/12/12 03:19:56 tholo Exp $"; | 7 | static char *rcsid = "$OpenBSD: ntohl.c,v 1.5 2005/03/25 13:24:12 otto Exp $"; |
8 | #endif /* LIBC_SCCS and not lint */ | 8 | #endif /* LIBC_SCCS and not lint */ |
9 | 9 | ||
10 | #include <sys/types.h> | 10 | #include <sys/types.h> |
@@ -13,8 +13,7 @@ static char *rcsid = "$OpenBSD: ntohl.c,v 1.4 1996/12/12 03:19:56 tholo Exp $"; | |||
13 | #undef ntohl | 13 | #undef ntohl |
14 | 14 | ||
15 | u_int32_t | 15 | u_int32_t |
16 | ntohl(x) | 16 | ntohl(u_int32_t x) |
17 | u_int32_t x; | ||
18 | { | 17 | { |
19 | #if BYTE_ORDER == LITTLE_ENDIAN | 18 | #if BYTE_ORDER == LITTLE_ENDIAN |
20 | u_char *s = (u_char *)&x; | 19 | u_char *s = (u_char *)&x; |
diff --git a/src/lib/libc/net/rcmd.c b/src/lib/libc/net/rcmd.c index 96d6256760..bfe8c3ae56 100644 --- a/src/lib/libc/net/rcmd.c +++ b/src/lib/libc/net/rcmd.c | |||
@@ -29,7 +29,7 @@ | |||
29 | */ | 29 | */ |
30 | 30 | ||
31 | #if defined(LIBC_SCCS) && !defined(lint) | 31 | #if defined(LIBC_SCCS) && !defined(lint) |
32 | static char *rcsid = "$OpenBSD: rcmd.c,v 1.51 2005/03/08 18:34:42 deraadt Exp $"; | 32 | static char *rcsid = "$OpenBSD: rcmd.c,v 1.52 2005/03/25 13:24:12 otto Exp $"; |
33 | #endif /* LIBC_SCCS and not lint */ | 33 | #endif /* LIBC_SCCS and not lint */ |
34 | 34 | ||
35 | #include <sys/param.h> | 35 | #include <sys/param.h> |
@@ -59,22 +59,15 @@ static int __icheckhost(struct sockaddr *, socklen_t, const char *); | |||
59 | static char *__gethostloop(struct sockaddr *, socklen_t); | 59 | static char *__gethostloop(struct sockaddr *, socklen_t); |
60 | 60 | ||
61 | int | 61 | int |
62 | rcmd(ahost, rport, locuser, remuser, cmd, fd2p) | 62 | rcmd(char **ahost, int rport, const char *locuser, const char *remuser, |
63 | char **ahost; | 63 | const char *cmd, int *fd2p) |
64 | in_port_t rport; | ||
65 | const char *locuser, *remuser, *cmd; | ||
66 | int *fd2p; | ||
67 | { | 64 | { |
68 | return rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, AF_INET); | 65 | return rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, AF_INET); |
69 | } | 66 | } |
70 | 67 | ||
71 | int | 68 | int |
72 | rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af) | 69 | rcmd_af(char **ahost, int porta, const char *locuser, const char *remuser, |
73 | char **ahost; | 70 | const char *cmd, int *fd2p, int af) |
74 | in_port_t rport; | ||
75 | const char *locuser, *remuser, *cmd; | ||
76 | int *fd2p; | ||
77 | int af; | ||
78 | { | 71 | { |
79 | static char hbuf[MAXHOSTNAMELEN]; | 72 | static char hbuf[MAXHOSTNAMELEN]; |
80 | char pbuf[NI_MAXSERV]; | 73 | char pbuf[NI_MAXSERV]; |
@@ -87,6 +80,7 @@ rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af) | |||
87 | int s, lport, timo; | 80 | int s, lport, timo; |
88 | char c, *p; | 81 | char c, *p; |
89 | int refused; | 82 | int refused; |
83 | in_port_t rport = porta; | ||
90 | 84 | ||
91 | /* call rcmdsh() with specified remote shell if appropriate. */ | 85 | /* call rcmdsh() with specified remote shell if appropriate. */ |
92 | if (!issetugid() && (p = getenv("RSH")) && *p) { | 86 | if (!issetugid() && (p = getenv("RSH")) && *p) { |
@@ -322,9 +316,7 @@ int __check_rhosts_file = 1; | |||
322 | char *__rcmd_errstr; | 316 | char *__rcmd_errstr; |
323 | 317 | ||
324 | int | 318 | int |
325 | ruserok(rhost, superuser, ruser, luser) | 319 | ruserok(const char *rhost, int superuser, const char *ruser, const char *luser) |
326 | const char *rhost, *ruser, *luser; | ||
327 | int superuser; | ||
328 | { | 320 | { |
329 | struct addrinfo hints, *res, *r; | 321 | struct addrinfo hints, *res, *r; |
330 | int error; | 322 | int error; |
@@ -357,10 +349,7 @@ ruserok(rhost, superuser, ruser, luser) | |||
357 | * Returns 0 if ok, -1 if not ok. | 349 | * Returns 0 if ok, -1 if not ok. |
358 | */ | 350 | */ |
359 | int | 351 | int |
360 | iruserok(raddr, superuser, ruser, luser) | 352 | iruserok(u_int32_t raddr, int superuser, const char *ruser, const char *luser) |
361 | u_int32_t raddr; | ||
362 | int superuser; | ||
363 | const char *ruser, *luser; | ||
364 | { | 353 | { |
365 | struct sockaddr_in sin; | 354 | struct sockaddr_in sin; |
366 | 355 | ||
@@ -373,14 +362,11 @@ iruserok(raddr, superuser, ruser, luser) | |||
373 | } | 362 | } |
374 | 363 | ||
375 | int | 364 | int |
376 | iruserok_sa(raddr, rlen, superuser, ruser, luser) | 365 | iruserok_sa(const void *raddr, int rlen, int superuser, const char *ruser, |
377 | const void *raddr; | 366 | const char *luser) |
378 | int rlen; | ||
379 | int superuser; | ||
380 | const char *ruser, *luser; | ||
381 | { | 367 | { |
382 | struct sockaddr *sa; | 368 | struct sockaddr *sa; |
383 | register char *cp; | 369 | char *cp; |
384 | struct stat sbuf; | 370 | struct stat sbuf; |
385 | struct passwd *pwd; | 371 | struct passwd *pwd; |
386 | FILE *hostf; | 372 | FILE *hostf; |
@@ -450,10 +436,8 @@ again: | |||
450 | * Returns 0 if ok, -1 if not ok. | 436 | * Returns 0 if ok, -1 if not ok. |
451 | */ | 437 | */ |
452 | int | 438 | int |
453 | __ivaliduser(hostf, raddrl, luser, ruser) | 439 | __ivaliduser(FILE *hostf, in_addr_t raddrl, const char *luser, |
454 | FILE *hostf; | 440 | const char *ruser) |
455 | in_addr_t raddrl; | ||
456 | const char *luser, *ruser; | ||
457 | { | 441 | { |
458 | struct sockaddr_in sin; | 442 | struct sockaddr_in sin; |
459 | 443 | ||
@@ -466,13 +450,10 @@ __ivaliduser(hostf, raddrl, luser, ruser) | |||
466 | } | 450 | } |
467 | 451 | ||
468 | int | 452 | int |
469 | __ivaliduser_sa(hostf, raddr, salen, luser, ruser) | 453 | __ivaliduser_sa(FILE *hostf, struct sockaddr *raddr, socklen_t salen, |
470 | FILE *hostf; | 454 | const char *luser, const char *ruser) |
471 | struct sockaddr *raddr; | ||
472 | socklen_t salen; | ||
473 | const char *luser, *ruser; | ||
474 | { | 455 | { |
475 | register char *user, *p; | 456 | char *user, *p; |
476 | char *buf; | 457 | char *buf; |
477 | const char *auser, *ahost; | 458 | const char *auser, *ahost; |
478 | int hostok, userok; | 459 | int hostok, userok; |
@@ -613,10 +594,7 @@ bail: | |||
613 | * semblance of an A->PTR->A loop, allow a simple #.#.#.# match to work. | 594 | * semblance of an A->PTR->A loop, allow a simple #.#.#.# match to work. |
614 | */ | 595 | */ |
615 | static int | 596 | static int |
616 | __icheckhost(raddr, salen, lhost) | 597 | __icheckhost(struct sockaddr *raddr, socklen_t salen, const char *lhost) |
617 | struct sockaddr *raddr; | ||
618 | socklen_t salen; | ||
619 | const char *lhost; | ||
620 | { | 598 | { |
621 | struct addrinfo hints, *res, *r; | 599 | struct addrinfo hints, *res, *r; |
622 | char h1[NI_MAXHOST], h2[NI_MAXHOST]; | 600 | char h1[NI_MAXHOST], h2[NI_MAXHOST]; |
@@ -662,9 +640,7 @@ __icheckhost(raddr, salen, lhost) | |||
662 | * be found, pack the result of inet_ntoa() into the string. | 640 | * be found, pack the result of inet_ntoa() into the string. |
663 | */ | 641 | */ |
664 | static char * | 642 | static char * |
665 | __gethostloop(raddr, salen) | 643 | __gethostloop(struct sockaddr *raddr, socklen_t salen) |
666 | struct sockaddr *raddr; | ||
667 | socklen_t salen; | ||
668 | { | 644 | { |
669 | static char remotehost[NI_MAXHOST]; | 645 | static char remotehost[NI_MAXHOST]; |
670 | char h1[NI_MAXHOST], h2[NI_MAXHOST]; | 646 | char h1[NI_MAXHOST], h2[NI_MAXHOST]; |
diff --git a/src/lib/libc/net/rcmdsh.c b/src/lib/libc/net/rcmdsh.c index 3ec97e4763..28f0ca88a6 100644 --- a/src/lib/libc/net/rcmdsh.c +++ b/src/lib/libc/net/rcmdsh.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rcmdsh.c,v 1.9 2004/04/01 04:14:29 marc Exp $ */ | 1 | /* $OpenBSD: rcmdsh.c,v 1.10 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2001, MagniComp | 4 | * Copyright (c) 2001, MagniComp |
@@ -34,7 +34,7 @@ | |||
34 | */ | 34 | */ |
35 | 35 | ||
36 | #if defined(LIBC_SCCS) && !defined(lint) | 36 | #if defined(LIBC_SCCS) && !defined(lint) |
37 | static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.9 2004/04/01 04:14:29 marc Exp $"; | 37 | static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.10 2005/03/25 13:24:12 otto Exp $"; |
38 | #endif /* LIBC_SCCS and not lint */ | 38 | #endif /* LIBC_SCCS and not lint */ |
39 | 39 | ||
40 | #include <sys/types.h> | 40 | #include <sys/types.h> |
@@ -57,11 +57,8 @@ static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.9 2004/04/01 04:14:29 marc Exp $"; | |||
57 | */ | 57 | */ |
58 | /* ARGSUSED */ | 58 | /* ARGSUSED */ |
59 | int | 59 | int |
60 | rcmdsh(ahost, rport, locuser, remuser, cmd, rshprog) | 60 | rcmdsh(char **ahost, int rport, const char *locuser, const char *remuser, |
61 | char **ahost; | 61 | const char *cmd, char *rshprog) |
62 | int rport; | ||
63 | const char *locuser, *remuser, *cmd; | ||
64 | char *rshprog; | ||
65 | { | 62 | { |
66 | struct hostent *hp; | 63 | struct hostent *hp; |
67 | int sp[2]; | 64 | int sp[2]; |
diff --git a/src/lib/libc/net/recv.c b/src/lib/libc/net/recv.c index 0947465377..981b5e7a6a 100644 --- a/src/lib/libc/net/recv.c +++ b/src/lib/libc/net/recv.c | |||
@@ -28,7 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #if defined(LIBC_SCCS) && !defined(lint) | 30 | #if defined(LIBC_SCCS) && !defined(lint) |
31 | static char rcsid[] = "$OpenBSD: recv.c,v 1.3 2003/06/02 20:18:35 millert Exp $"; | 31 | static char rcsid[] = "$OpenBSD: recv.c,v 1.4 2005/03/25 13:24:12 otto Exp $"; |
32 | #endif /* LIBC_SCCS and not lint */ | 32 | #endif /* LIBC_SCCS and not lint */ |
33 | 33 | ||
34 | #include <sys/types.h> | 34 | #include <sys/types.h> |
@@ -37,10 +37,7 @@ static char rcsid[] = "$OpenBSD: recv.c,v 1.3 2003/06/02 20:18:35 millert Exp $" | |||
37 | #include <stddef.h> | 37 | #include <stddef.h> |
38 | 38 | ||
39 | ssize_t | 39 | ssize_t |
40 | recv(s, buf, len, flags) | 40 | recv(int s, void *buf, size_t len, int flags) |
41 | int s, flags; | ||
42 | size_t len; | ||
43 | void *buf; | ||
44 | { | 41 | { |
45 | return (recvfrom(s, buf, len, flags, NULL, 0)); | 42 | return (recvfrom(s, buf, len, flags, NULL, 0)); |
46 | } | 43 | } |
diff --git a/src/lib/libc/net/res_comp.c b/src/lib/libc/net/res_comp.c index c10eb52931..62c04d8518 100644 --- a/src/lib/libc/net/res_comp.c +++ b/src/lib/libc/net/res_comp.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: res_comp.c,v 1.11 2003/06/02 20:18:36 millert Exp $ */ | 1 | /* $OpenBSD: res_comp.c,v 1.12 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * ++Copyright++ 1985, 1993 | 4 | * ++Copyright++ 1985, 1993 |
@@ -56,7 +56,7 @@ | |||
56 | static char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93"; | 56 | static char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93"; |
57 | static char rcsid[] = "$From: res_comp.c,v 8.11 1996/12/02 09:17:22 vixie Exp $"; | 57 | static char rcsid[] = "$From: res_comp.c,v 8.11 1996/12/02 09:17:22 vixie Exp $"; |
58 | #else | 58 | #else |
59 | static char rcsid[] = "$OpenBSD: res_comp.c,v 1.11 2003/06/02 20:18:36 millert Exp $"; | 59 | static char rcsid[] = "$OpenBSD: res_comp.c,v 1.12 2005/03/25 13:24:12 otto Exp $"; |
60 | #endif | 60 | #endif |
61 | #endif /* LIBC_SCCS and not lint */ | 61 | #endif /* LIBC_SCCS and not lint */ |
62 | 62 | ||
@@ -82,14 +82,12 @@ static int dn_find(u_char *, u_char *, u_char **, u_char **); | |||
82 | * Return size of compressed name or -1 if there was an error. | 82 | * Return size of compressed name or -1 if there was an error. |
83 | */ | 83 | */ |
84 | int | 84 | int |
85 | dn_expand(msg, eomorig, comp_dn, exp_dn, length) | 85 | dn_expand(const u_char *msg, const u_char *eomorig, const u_char *comp_dn, |
86 | const u_char *msg, *eomorig, *comp_dn; | 86 | char *exp_dn, int length) |
87 | char *exp_dn; | ||
88 | int length; | ||
89 | { | 87 | { |
90 | register const u_char *cp; | 88 | const u_char *cp; |
91 | register char *dn; | 89 | char *dn; |
92 | register int n, c; | 90 | int n, c; |
93 | char *eom; | 91 | char *eom; |
94 | int len = -1, checked = 0; | 92 | int len = -1, checked = 0; |
95 | 93 | ||
@@ -166,13 +164,11 @@ dn_expand(msg, eomorig, comp_dn, exp_dn, length) | |||
166 | * is NULL, we don't update the list. | 164 | * is NULL, we don't update the list. |
167 | */ | 165 | */ |
168 | int | 166 | int |
169 | dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr) | 167 | dn_comp(const char *exp_dn, u_char *comp_dn, int length, u_char **dnptrs, |
170 | const char *exp_dn; | 168 | u_char **lastdnptr) |
171 | u_char *comp_dn, **dnptrs, **lastdnptr; | ||
172 | int length; | ||
173 | { | 169 | { |
174 | register u_char *cp, *dn; | 170 | u_char *cp, *dn; |
175 | register int c, l; | 171 | int c, l; |
176 | u_char **cpp, **lpp, *sp, *eob; | 172 | u_char **cpp, **lpp, *sp, *eob; |
177 | u_char *msg; | 173 | u_char *msg; |
178 | 174 | ||
@@ -246,11 +242,10 @@ dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr) | |||
246 | * Skip over a compressed domain name. Return the size or -1. | 242 | * Skip over a compressed domain name. Return the size or -1. |
247 | */ | 243 | */ |
248 | int | 244 | int |
249 | __dn_skipname(comp_dn, eom) | 245 | __dn_skipname(const u_char *comp_dn, const u_char *eom) |
250 | const u_char *comp_dn, *eom; | ||
251 | { | 246 | { |
252 | register const u_char *cp; | 247 | const u_char *cp; |
253 | register int n; | 248 | int n; |
254 | 249 | ||
255 | cp = comp_dn; | 250 | cp = comp_dn; |
256 | while (cp < eom && (n = *cp++)) { | 251 | while (cp < eom && (n = *cp++)) { |
@@ -275,8 +270,7 @@ __dn_skipname(comp_dn, eom) | |||
275 | } | 270 | } |
276 | 271 | ||
277 | static int | 272 | static int |
278 | mklower(ch) | 273 | mklower(int ch) |
279 | register int ch; | ||
280 | { | 274 | { |
281 | if (isascii(ch) && isupper(ch)) | 275 | if (isascii(ch) && isupper(ch)) |
282 | return (tolower(ch)); | 276 | return (tolower(ch)); |
@@ -290,12 +284,10 @@ mklower(ch) | |||
290 | * not the pointer to the start of the message. | 284 | * not the pointer to the start of the message. |
291 | */ | 285 | */ |
292 | static int | 286 | static int |
293 | dn_find(exp_dn, msg, dnptrs, lastdnptr) | 287 | dn_find(u_char *exp_dn, u_char *msg, u_char **dnptrs, u_char **lastdnptr) |
294 | u_char *exp_dn, *msg; | ||
295 | u_char **dnptrs, **lastdnptr; | ||
296 | { | 288 | { |
297 | register u_char *dn, *cp, **cpp; | 289 | u_char *dn, *cp, **cpp; |
298 | register int n; | 290 | int n; |
299 | u_char *sp; | 291 | u_char *sp; |
300 | 292 | ||
301 | for (cpp = dnptrs; cpp < lastdnptr; cpp++) { | 293 | for (cpp = dnptrs; cpp < lastdnptr; cpp++) { |
@@ -360,8 +352,7 @@ dn_find(exp_dn, msg, dnptrs, lastdnptr) | |||
360 | #define domainchar(c) ((c) > 0x20 && (c) < 0x7f) | 352 | #define domainchar(c) ((c) > 0x20 && (c) < 0x7f) |
361 | 353 | ||
362 | int | 354 | int |
363 | res_hnok(dn) | 355 | res_hnok(const char *dn) |
364 | const char *dn; | ||
365 | { | 356 | { |
366 | int pch = PERIOD, ch = *dn++; | 357 | int pch = PERIOD, ch = *dn++; |
367 | 358 | ||
@@ -390,8 +381,7 @@ res_hnok(dn) | |||
390 | * but must otherwise be as a host name. | 381 | * but must otherwise be as a host name. |
391 | */ | 382 | */ |
392 | int | 383 | int |
393 | res_ownok(dn) | 384 | res_ownok(const char *dn) |
394 | const char *dn; | ||
395 | { | 385 | { |
396 | if (asterchar(dn[0])) { | 386 | if (asterchar(dn[0])) { |
397 | if (periodchar(dn[1])) | 387 | if (periodchar(dn[1])) |
@@ -407,8 +397,7 @@ res_ownok(dn) | |||
407 | * label, but the rest of the name has to look like a host name. | 397 | * label, but the rest of the name has to look like a host name. |
408 | */ | 398 | */ |
409 | int | 399 | int |
410 | res_mailok(dn) | 400 | res_mailok(const char *dn) |
411 | const char *dn; | ||
412 | { | 401 | { |
413 | int ch, escaped = 0; | 402 | int ch, escaped = 0; |
414 | 403 | ||
@@ -437,8 +426,7 @@ res_mailok(dn) | |||
437 | * recommendations. | 426 | * recommendations. |
438 | */ | 427 | */ |
439 | int | 428 | int |
440 | res_dnok(dn) | 429 | res_dnok(const char *dn) |
441 | const char *dn; | ||
442 | { | 430 | { |
443 | int ch; | 431 | int ch; |
444 | 432 | ||
@@ -453,10 +441,9 @@ res_dnok(dn) | |||
453 | */ | 441 | */ |
454 | 442 | ||
455 | u_int16_t | 443 | u_int16_t |
456 | _getshort(msgp) | 444 | _getshort(const u_char *msgp) |
457 | register const u_char *msgp; | ||
458 | { | 445 | { |
459 | register u_int16_t u; | 446 | u_int16_t u; |
460 | 447 | ||
461 | GETSHORT(u, msgp); | 448 | GETSHORT(u, msgp); |
462 | return (u); | 449 | return (u); |
@@ -468,32 +455,29 @@ _getshort(msgp) | |||
468 | */ | 455 | */ |
469 | u_int16_t | 456 | u_int16_t |
470 | res_getshort(msgp) | 457 | res_getshort(msgp) |
471 | register const u_char *msgp; | 458 | const u_char *msgp; |
472 | { | 459 | { |
473 | return (_getshort(msgp)); | 460 | return (_getshort(msgp)); |
474 | } | 461 | } |
475 | #endif | 462 | #endif |
476 | 463 | ||
477 | u_int32_t | 464 | u_int32_t |
478 | _getlong(msgp) | 465 | _getlong(const u_char *msgp) |
479 | register const u_char *msgp; | ||
480 | { | 466 | { |
481 | register u_int32_t u; | 467 | u_int32_t u; |
482 | 468 | ||
483 | GETLONG(u, msgp); | 469 | GETLONG(u, msgp); |
484 | return (u); | 470 | return (u); |
485 | } | 471 | } |
486 | 472 | ||
487 | void | 473 | void |
488 | __putshort(register u_int16_t s, register u_char *msgp) | 474 | __putshort(u_int16_t s, u_char *msgp) |
489 | { | 475 | { |
490 | PUTSHORT(s, msgp); | 476 | PUTSHORT(s, msgp); |
491 | } | 477 | } |
492 | 478 | ||
493 | void | 479 | void |
494 | __putlong(l, msgp) | 480 | __putlong(u_int32_t l, u_char *msgp) |
495 | register u_int32_t l; | ||
496 | register u_char *msgp; | ||
497 | { | 481 | { |
498 | PUTLONG(l, msgp); | 482 | PUTLONG(l, msgp); |
499 | } | 483 | } |
diff --git a/src/lib/libc/net/res_debug.c b/src/lib/libc/net/res_debug.c index e0f2a89418..02f9e4a1ea 100644 --- a/src/lib/libc/net/res_debug.c +++ b/src/lib/libc/net/res_debug.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: res_debug.c,v 1.18 2005/03/06 16:17:23 moritz Exp $ */ | 1 | /* $OpenBSD: res_debug.c,v 1.19 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * ++Copyright++ 1985, 1990, 1993 | 4 | * ++Copyright++ 1985, 1990, 1993 |
@@ -78,7 +78,7 @@ | |||
78 | static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93"; | 78 | static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93"; |
79 | static char rcsid[] = "$From: res_debug.c,v 8.19 1996/11/26 10:11:23 vixie Exp $"; | 79 | static char rcsid[] = "$From: res_debug.c,v 8.19 1996/11/26 10:11:23 vixie Exp $"; |
80 | #else | 80 | #else |
81 | static char rcsid[] = "$OpenBSD: res_debug.c,v 1.18 2005/03/06 16:17:23 moritz Exp $"; | 81 | static char rcsid[] = "$OpenBSD: res_debug.c,v 1.19 2005/03/25 13:24:12 otto Exp $"; |
82 | #endif | 82 | #endif |
83 | #endif /* LIBC_SCCS and not lint */ | 83 | #endif /* LIBC_SCCS and not lint */ |
84 | 84 | ||
@@ -107,8 +107,7 @@ static const char *loc_ntoal(const u_char *binary, char *ascii, int ascii_len); | |||
107 | 107 | ||
108 | /* XXX: we should use getservbyport() instead. */ | 108 | /* XXX: we should use getservbyport() instead. */ |
109 | static const char * | 109 | static const char * |
110 | dewks(wks) | 110 | dewks(int wks) |
111 | int wks; | ||
112 | { | 111 | { |
113 | static char nbuf[20]; | 112 | static char nbuf[20]; |
114 | 113 | ||
@@ -167,8 +166,7 @@ dewks(wks) | |||
167 | 166 | ||
168 | /* XXX: we should use getprotobynumber() instead. */ | 167 | /* XXX: we should use getprotobynumber() instead. */ |
169 | static const char * | 168 | static const char * |
170 | deproto(protonum) | 169 | deproto(int protonum) |
171 | int protonum; | ||
172 | { | 170 | { |
173 | static char nbuf[20]; | 171 | static char nbuf[20]; |
174 | 172 | ||
@@ -192,11 +190,8 @@ deproto(protonum) | |||
192 | } | 190 | } |
193 | 191 | ||
194 | static const u_char * | 192 | static const u_char * |
195 | do_rrset(msg, len, cp, cnt, pflag, file, hs) | 193 | do_rrset(const u_char *msg, int len, const u_char *cp, int cnt, int pflag, |
196 | int cnt, pflag, len; | 194 | FILE *file, const char *hs) |
197 | const u_char *cp, *msg; | ||
198 | const char *hs; | ||
199 | FILE *file; | ||
200 | { | 195 | { |
201 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 196 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
202 | int n; | 197 | int n; |
@@ -234,8 +229,7 @@ do_rrset(msg, len, cp, cnt, pflag, file, hs) | |||
234 | } | 229 | } |
235 | 230 | ||
236 | void | 231 | void |
237 | __p_query(msg) | 232 | __p_query(const u_char *msg) |
238 | const u_char *msg; | ||
239 | { | 233 | { |
240 | __fp_query(msg, stdout); | 234 | __fp_query(msg, stdout); |
241 | } | 235 | } |
@@ -245,11 +239,9 @@ __p_query(msg) | |||
245 | * This is intended to be primarily a debugging routine. | 239 | * This is intended to be primarily a debugging routine. |
246 | */ | 240 | */ |
247 | void | 241 | void |
248 | __fp_resstat(statp, file) | 242 | __fp_resstat(struct __res_state *statp, FILE *file) |
249 | struct __res_state *statp; | ||
250 | FILE *file; | ||
251 | { | 243 | { |
252 | register u_long mask; | 244 | u_long mask; |
253 | 245 | ||
254 | fprintf(file, ";; res options:"); | 246 | fprintf(file, ";; res options:"); |
255 | if (!statp) | 247 | if (!statp) |
@@ -265,15 +257,12 @@ __fp_resstat(statp, file) | |||
265 | * This is intended to be primarily a debugging routine. | 257 | * This is intended to be primarily a debugging routine. |
266 | */ | 258 | */ |
267 | void | 259 | void |
268 | __fp_nquery(msg, len, file) | 260 | __fp_nquery(const u_char *msg, int len, FILE *file) |
269 | const u_char *msg; | ||
270 | int len; | ||
271 | FILE *file; | ||
272 | { | 261 | { |
273 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 262 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
274 | register const u_char *cp, *endMark; | 263 | const u_char *cp, *endMark; |
275 | register const HEADER *hp; | 264 | const HEADER *hp; |
276 | register int n; | 265 | int n; |
277 | 266 | ||
278 | if ((_resp->options & RES_INIT) == 0 && res_init() == -1) | 267 | if ((_resp->options & RES_INIT) == 0 && res_init() == -1) |
279 | return; | 268 | return; |
@@ -394,18 +383,13 @@ __fp_nquery(msg, len, file) | |||
394 | } | 383 | } |
395 | 384 | ||
396 | void | 385 | void |
397 | __fp_query(msg, file) | 386 | __fp_query(const u_char *msg, FILE *file) |
398 | const u_char *msg; | ||
399 | FILE *file; | ||
400 | { | 387 | { |
401 | fp_nquery(msg, PACKETSZ, file); | 388 | fp_nquery(msg, PACKETSZ, file); |
402 | } | 389 | } |
403 | 390 | ||
404 | const u_char * | 391 | const u_char * |
405 | __p_cdnname(cp, msg, len, file) | 392 | __p_cdnname(const u_char *cp, const u_char *msg, int len, FILE *file) |
406 | const u_char *cp, *msg; | ||
407 | int len; | ||
408 | FILE *file; | ||
409 | { | 393 | { |
410 | char name[MAXDNAME]; | 394 | char name[MAXDNAME]; |
411 | int n; | 395 | int n; |
@@ -420,9 +404,7 @@ __p_cdnname(cp, msg, len, file) | |||
420 | } | 404 | } |
421 | 405 | ||
422 | const u_char * | 406 | const u_char * |
423 | __p_cdname(cp, msg, file) | 407 | __p_cdname(const u_char *cp, const u_char *msg, FILE *file) |
424 | const u_char *cp, *msg; | ||
425 | FILE *file; | ||
426 | { | 408 | { |
427 | return (p_cdnname(cp, msg, PACKETSZ, file)); | 409 | return (p_cdnname(cp, msg, PACKETSZ, file)); |
428 | } | 410 | } |
@@ -432,11 +414,7 @@ __p_cdname(cp, msg, file) | |||
432 | length supplied). */ | 414 | length supplied). */ |
433 | 415 | ||
434 | const u_char * | 416 | const u_char * |
435 | __p_fqnname(cp, msg, msglen, name, namelen) | 417 | __p_fqnname(const u_char *cp, const u_char *msg, int msglen, char *name, int namelen) |
436 | const u_char *cp, *msg; | ||
437 | int msglen; | ||
438 | char *name; | ||
439 | int namelen; | ||
440 | { | 418 | { |
441 | int n, newlen; | 419 | int n, newlen; |
442 | 420 | ||
@@ -456,9 +434,7 @@ __p_fqnname(cp, msg, msglen, name, namelen) | |||
456 | */ | 434 | */ |
457 | 435 | ||
458 | const u_char * | 436 | const u_char * |
459 | __p_fqname(cp, msg, file) | 437 | __p_fqname(const u_char *cp, const u_char *msg, FILE *file) |
460 | const u_char *cp, *msg; | ||
461 | FILE *file; | ||
462 | { | 438 | { |
463 | char name[MAXDNAME]; | 439 | char name[MAXDNAME]; |
464 | const u_char *n; | 440 | const u_char *n; |
@@ -474,9 +450,7 @@ __p_fqname(cp, msg, file) | |||
474 | * Print resource record fields in human readable form. | 450 | * Print resource record fields in human readable form. |
475 | */ | 451 | */ |
476 | const u_char * | 452 | const u_char * |
477 | __p_rr(cp, msg, file) | 453 | __p_rr(const u_char *cp, const u_char *msg, FILE *file) |
478 | const u_char *cp, *msg; | ||
479 | FILE *file; | ||
480 | { | 454 | { |
481 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 455 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
482 | int type, class, dlen, n, c; | 456 | int type, class, dlen, n, c; |
@@ -932,10 +906,7 @@ const struct res_sym __p_type_syms[] = { | |||
932 | }; | 906 | }; |
933 | 907 | ||
934 | int | 908 | int |
935 | __sym_ston(syms, name, success) | 909 | __sym_ston(const struct res_sym *syms, char *name, int *success) |
936 | const struct res_sym *syms; | ||
937 | char *name; | ||
938 | int *success; | ||
939 | { | 910 | { |
940 | for (; syms->name != 0; syms++) { | 911 | for (; syms->name != 0; syms++) { |
941 | if (strcasecmp (name, syms->name) == 0) { | 912 | if (strcasecmp (name, syms->name) == 0) { |
@@ -950,10 +921,7 @@ __sym_ston(syms, name, success) | |||
950 | } | 921 | } |
951 | 922 | ||
952 | const char * | 923 | const char * |
953 | __sym_ntos(syms, number, success) | 924 | __sym_ntos(const struct res_sym *syms, int number, int *success) |
954 | const struct res_sym *syms; | ||
955 | int number; | ||
956 | int *success; | ||
957 | { | 925 | { |
958 | static char unname[20]; | 926 | static char unname[20]; |
959 | 927 | ||
@@ -973,10 +941,7 @@ __sym_ntos(syms, number, success) | |||
973 | 941 | ||
974 | 942 | ||
975 | const char * | 943 | const char * |
976 | __sym_ntop(syms, number, success) | 944 | __sym_ntop(const struct res_sym *syms, int number, int *success) |
977 | const struct res_sym *syms; | ||
978 | int number; | ||
979 | int *success; | ||
980 | { | 945 | { |
981 | static char unname[20]; | 946 | static char unname[20]; |
982 | 947 | ||
@@ -997,8 +962,7 @@ __sym_ntop(syms, number, success) | |||
997 | * Return a string for the type | 962 | * Return a string for the type |
998 | */ | 963 | */ |
999 | const char * | 964 | const char * |
1000 | __p_type(type) | 965 | __p_type(int type) |
1001 | int type; | ||
1002 | { | 966 | { |
1003 | return (__sym_ntos (__p_type_syms, type, (int *)0)); | 967 | return (__sym_ntos (__p_type_syms, type, (int *)0)); |
1004 | } | 968 | } |
@@ -1007,8 +971,7 @@ __p_type(type) | |||
1007 | * Return a mnemonic for class | 971 | * Return a mnemonic for class |
1008 | */ | 972 | */ |
1009 | const char * | 973 | const char * |
1010 | __p_class(class) | 974 | __p_class(int class) |
1011 | int class; | ||
1012 | { | 975 | { |
1013 | return (__sym_ntos (__p_class_syms, class, (int *)0)); | 976 | return (__sym_ntos (__p_class_syms, class, (int *)0)); |
1014 | } | 977 | } |
@@ -1017,8 +980,7 @@ __p_class(class) | |||
1017 | * Return a mnemonic for an option | 980 | * Return a mnemonic for an option |
1018 | */ | 981 | */ |
1019 | const char * | 982 | const char * |
1020 | __p_option(option) | 983 | __p_option(u_long option) |
1021 | u_long option; | ||
1022 | { | 984 | { |
1023 | static char nbuf[40]; | 985 | static char nbuf[40]; |
1024 | 986 | ||
@@ -1047,13 +1009,12 @@ __p_option(option) | |||
1047 | * Return a mnemonic for a time to live | 1009 | * Return a mnemonic for a time to live |
1048 | */ | 1010 | */ |
1049 | const char * | 1011 | const char * |
1050 | p_time(value) | 1012 | p_time(u_int32_t value) |
1051 | u_int32_t value; | ||
1052 | { | 1013 | { |
1053 | static char nbuf[40]; | 1014 | static char nbuf[40]; |
1054 | char *ebuf; | 1015 | char *ebuf; |
1055 | int secs, mins, hours, days; | 1016 | int secs, mins, hours, days; |
1056 | register char *p; | 1017 | char *p; |
1057 | int tmp; | 1018 | int tmp; |
1058 | 1019 | ||
1059 | if (value == 0) { | 1020 | if (value == 0) { |
@@ -1129,8 +1090,7 @@ static unsigned int poweroften[10] = {1, 10, 100, 1000, 10000, 100000, | |||
1129 | 1090 | ||
1130 | /* takes an XeY precision/size value, returns a string representation. */ | 1091 | /* takes an XeY precision/size value, returns a string representation. */ |
1131 | static const char * | 1092 | static const char * |
1132 | precsize_ntoa(prec) | 1093 | precsize_ntoa(u_int8_t prec) |
1133 | u_int8_t prec; | ||
1134 | { | 1094 | { |
1135 | static char retbuf[sizeof "90000000.00"]; | 1095 | static char retbuf[sizeof "90000000.00"]; |
1136 | unsigned long val; | 1096 | unsigned long val; |
@@ -1147,14 +1107,13 @@ precsize_ntoa(prec) | |||
1147 | 1107 | ||
1148 | /* converts ascii size/precision X * 10**Y(cm) to 0xXY. moves pointer. */ | 1108 | /* converts ascii size/precision X * 10**Y(cm) to 0xXY. moves pointer. */ |
1149 | static u_int8_t | 1109 | static u_int8_t |
1150 | precsize_aton(strptr) | 1110 | precsize_aton(char **strptr) |
1151 | char **strptr; | ||
1152 | { | 1111 | { |
1153 | unsigned int mval = 0, cmval = 0; | 1112 | unsigned int mval = 0, cmval = 0; |
1154 | u_int8_t retval = 0; | 1113 | u_int8_t retval = 0; |
1155 | register char *cp; | 1114 | char *cp; |
1156 | register int exponent; | 1115 | int exponent; |
1157 | register int mantissa; | 1116 | int mantissa; |
1158 | 1117 | ||
1159 | cp = *strptr; | 1118 | cp = *strptr; |
1160 | 1119 | ||
@@ -1189,11 +1148,9 @@ precsize_aton(strptr) | |||
1189 | 1148 | ||
1190 | /* converts ascii lat/lon to unsigned encoded 32-bit number. moves pointer. */ | 1149 | /* converts ascii lat/lon to unsigned encoded 32-bit number. moves pointer. */ |
1191 | static u_int32_t | 1150 | static u_int32_t |
1192 | latlon2ul(latlonstrptr,which) | 1151 | latlon2ul(char **latlonstrptr, int *which) |
1193 | char **latlonstrptr; | ||
1194 | int *which; | ||
1195 | { | 1152 | { |
1196 | register char *cp; | 1153 | char *cp; |
1197 | u_int32_t retval; | 1154 | u_int32_t retval; |
1198 | int deg = 0, min = 0, secs = 0, secsfrac = 0; | 1155 | int deg = 0, min = 0, secs = 0, secsfrac = 0; |
1199 | 1156 | ||
@@ -1288,9 +1245,7 @@ latlon2ul(latlonstrptr,which) | |||
1288 | /* converts a zone file representation in a string to an RDATA on-the-wire | 1245 | /* converts a zone file representation in a string to an RDATA on-the-wire |
1289 | * representation. */ | 1246 | * representation. */ |
1290 | int | 1247 | int |
1291 | loc_aton(ascii, binary) | 1248 | loc_aton(const char *ascii, u_char *binary) |
1292 | const char *ascii; | ||
1293 | u_char *binary; | ||
1294 | { | 1249 | { |
1295 | const char *maxcp; | 1250 | const char *maxcp; |
1296 | u_char *bcp; | 1251 | u_char *bcp; |
@@ -1399,22 +1354,17 @@ loc_aton(ascii, binary) | |||
1399 | } | 1354 | } |
1400 | 1355 | ||
1401 | const char * | 1356 | const char * |
1402 | loc_ntoa(binary, ascii) | 1357 | loc_ntoa(const u_char *binary, char *ascii) |
1403 | const u_char *binary; | ||
1404 | char *ascii; | ||
1405 | { | 1358 | { |
1406 | return loc_ntoal(binary, ascii, 255); | 1359 | return loc_ntoal(binary, ascii, 255); |
1407 | } | 1360 | } |
1408 | 1361 | ||
1409 | /* takes an on-the-wire LOC RR and formats it in a human readable format. */ | 1362 | /* takes an on-the-wire LOC RR and formats it in a human readable format. */ |
1410 | static const char * | 1363 | static const char * |
1411 | loc_ntoal(binary, ascii, ascii_len) | 1364 | loc_ntoal(const u_char *binary, char *ascii, int ascii_len) |
1412 | const u_char *binary; | ||
1413 | char *ascii; | ||
1414 | int ascii_len; | ||
1415 | { | 1365 | { |
1416 | static char *error = "?"; | 1366 | static char *error = "?"; |
1417 | register const u_char *cp = binary; | 1367 | const u_char *cp = binary; |
1418 | 1368 | ||
1419 | int latdeg, latmin, latsec, latsecfrac; | 1369 | int latdeg, latmin, latsec, latsecfrac; |
1420 | int longdeg, longmin, longsec, longsecfrac; | 1370 | int longdeg, longmin, longsec, longsecfrac; |
@@ -1513,8 +1463,7 @@ loc_ntoal(binary, ascii, ascii_len) | |||
1513 | 1463 | ||
1514 | /* Return the number of DNS hierarchy levels in the name. */ | 1464 | /* Return the number of DNS hierarchy levels in the name. */ |
1515 | int | 1465 | int |
1516 | __dn_count_labels(name) | 1466 | __dn_count_labels(char *name) |
1517 | char *name; | ||
1518 | { | 1467 | { |
1519 | int i, len, count; | 1468 | int i, len, count; |
1520 | 1469 | ||
@@ -1544,8 +1493,7 @@ __dn_count_labels(name) | |||
1544 | * SIG records are required to be printed like this, by the Secure DNS RFC. | 1493 | * SIG records are required to be printed like this, by the Secure DNS RFC. |
1545 | */ | 1494 | */ |
1546 | char * | 1495 | char * |
1547 | __p_secstodate (secs) | 1496 | __p_secstodate (long unsigned int secs) |
1548 | unsigned long secs; | ||
1549 | { | 1497 | { |
1550 | static char output[15]; /* YYYYMMDDHHMMSS and null */ | 1498 | static char output[15]; /* YYYYMMDDHHMMSS and null */ |
1551 | time_t clock = secs; | 1499 | time_t clock = secs; |
diff --git a/src/lib/libc/net/res_init.c b/src/lib/libc/net/res_init.c index 79ccada6ee..f4a8d31cb1 100644 --- a/src/lib/libc/net/res_init.c +++ b/src/lib/libc/net/res_init.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: res_init.c,v 1.30 2004/06/07 21:11:23 marc Exp $ */ | 1 | /* $OpenBSD: res_init.c,v 1.31 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * ++Copyright++ 1985, 1989, 1993 | 4 | * ++Copyright++ 1985, 1989, 1993 |
@@ -60,7 +60,7 @@ | |||
60 | static char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93"; | 60 | static char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93"; |
61 | static char rcsid[] = "$From: res_init.c,v 8.7 1996/09/28 06:51:07 vixie Exp $"; | 61 | static char rcsid[] = "$From: res_init.c,v 8.7 1996/09/28 06:51:07 vixie Exp $"; |
62 | #else | 62 | #else |
63 | static char rcsid[] = "$OpenBSD: res_init.c,v 1.30 2004/06/07 21:11:23 marc Exp $"; | 63 | static char rcsid[] = "$OpenBSD: res_init.c,v 1.31 2005/03/25 13:24:12 otto Exp $"; |
64 | #endif | 64 | #endif |
65 | #endif /* LIBC_SCCS and not lint */ | 65 | #endif /* LIBC_SCCS and not lint */ |
66 | 66 | ||
@@ -153,16 +153,16 @@ struct __res_state_ext _res_ext; | |||
153 | * Return 0 if completes successfully, -1 on error | 153 | * Return 0 if completes successfully, -1 on error |
154 | */ | 154 | */ |
155 | int | 155 | int |
156 | res_init() | 156 | res_init(void) |
157 | { | 157 | { |
158 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 158 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
159 | #ifdef INET6 | 159 | #ifdef INET6 |
160 | struct __res_state_ext *_res_extp = _THREAD_PRIVATE(_res_ext, _res_ext, | 160 | struct __res_state_ext *_res_extp = _THREAD_PRIVATE(_res_ext, _res_ext, |
161 | &_res_ext); | 161 | &_res_ext); |
162 | #endif | 162 | #endif |
163 | register FILE *fp; | 163 | FILE *fp; |
164 | register char *cp, **pp; | 164 | char *cp, **pp; |
165 | register int n; | 165 | int n; |
166 | char buf[BUFSIZ]; | 166 | char buf[BUFSIZ]; |
167 | int nserv = 0; /* number of nameserver records read from file */ | 167 | int nserv = 0; /* number of nameserver records read from file */ |
168 | int haveenv = 0; | 168 | int haveenv = 0; |
@@ -571,8 +571,7 @@ res_init() | |||
571 | 571 | ||
572 | /* ARGSUSED */ | 572 | /* ARGSUSED */ |
573 | static void | 573 | static void |
574 | res_setoptions(options, source) | 574 | res_setoptions(char *options, char *source) |
575 | char *options, *source; | ||
576 | { | 575 | { |
577 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 576 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
578 | char *cp = options; | 577 | char *cp = options; |
@@ -632,10 +631,9 @@ res_setoptions(options, source) | |||
632 | #ifdef RESOLVSORT | 631 | #ifdef RESOLVSORT |
633 | /* XXX - should really support CIDR which means explicit masks always. */ | 632 | /* XXX - should really support CIDR which means explicit masks always. */ |
634 | static u_int32_t | 633 | static u_int32_t |
635 | net_mask(in) /* XXX - should really use system's version of this */ | 634 | net_mask(struct in_addr in) /* XXX - should really use system's version of this */ |
636 | struct in_addr in; | ||
637 | { | 635 | { |
638 | register u_int32_t i = ntohl(in.s_addr); | 636 | u_int32_t i = ntohl(in.s_addr); |
639 | 637 | ||
640 | if (IN_CLASSA(i)) | 638 | if (IN_CLASSA(i)) |
641 | return (htonl(IN_CLASSA_NET)); | 639 | return (htonl(IN_CLASSA_NET)); |
diff --git a/src/lib/libc/net/res_mkquery.c b/src/lib/libc/net/res_mkquery.c index 82aa2796c2..28ae92056d 100644 --- a/src/lib/libc/net/res_mkquery.c +++ b/src/lib/libc/net/res_mkquery.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: res_mkquery.c,v 1.14 2003/06/02 20:18:36 millert Exp $ */ | 1 | /* $OpenBSD: res_mkquery.c,v 1.15 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * ++Copyright++ 1985, 1993 | 4 | * ++Copyright++ 1985, 1993 |
@@ -56,7 +56,7 @@ | |||
56 | static char sccsid[] = "@(#)res_mkquery.c 8.1 (Berkeley) 6/4/93"; | 56 | static char sccsid[] = "@(#)res_mkquery.c 8.1 (Berkeley) 6/4/93"; |
57 | static char rcsid[] = "$From: res_mkquery.c,v 8.5 1996/08/27 08:33:28 vixie Exp $"; | 57 | static char rcsid[] = "$From: res_mkquery.c,v 8.5 1996/08/27 08:33:28 vixie Exp $"; |
58 | #else | 58 | #else |
59 | static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.14 2003/06/02 20:18:36 millert Exp $"; | 59 | static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.15 2005/03/25 13:24:12 otto Exp $"; |
60 | #endif | 60 | #endif |
61 | #endif /* LIBC_SCCS and not lint */ | 61 | #endif /* LIBC_SCCS and not lint */ |
62 | 62 | ||
@@ -78,20 +78,20 @@ static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.14 2003/06/02 20:18:36 miller | |||
78 | */ | 78 | */ |
79 | /* ARGSUSED */ | 79 | /* ARGSUSED */ |
80 | int | 80 | int |
81 | res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen) | 81 | res_mkquery(int op, |
82 | int op; /* opcode of query */ | 82 | const char *dname, /* opcode of query */ |
83 | const char *dname; /* domain name */ | 83 | int class, /* domain name */ |
84 | int class, type; /* class and type of query */ | 84 | int type, /* class and type of query */ |
85 | const u_char *data; /* resource record data */ | 85 | const u_char *data, /* resource record data */ |
86 | int datalen; /* length of data */ | 86 | int datalen, /* length of data */ |
87 | const u_char *newrr_in; /* new rr for modify or append */ | 87 | const u_char *newrr_in, /* new rr for modify or append */ |
88 | u_char *buf; /* buffer to put query */ | 88 | u_char *buf, /* buffer to put query */ |
89 | int buflen; /* size of buffer */ | 89 | int buflen) /* size of buffer */ |
90 | { | 90 | { |
91 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 91 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
92 | register HEADER *hp; | 92 | HEADER *hp; |
93 | register u_char *cp, *ep; | 93 | u_char *cp, *ep; |
94 | register int n; | 94 | int n; |
95 | u_char *dnptrs[20], **dpp, **lastdnptr; | 95 | u_char *dnptrs[20], **dpp, **lastdnptr; |
96 | 96 | ||
97 | if ((_resp->options & RES_INIT) == 0 && res_init() == -1) { | 97 | if ((_resp->options & RES_INIT) == 0 && res_init() == -1) { |
@@ -196,15 +196,14 @@ res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen) | |||
196 | 196 | ||
197 | /* attach OPT pseudo-RR, as documented in RFC2671 (EDNS0). */ | 197 | /* attach OPT pseudo-RR, as documented in RFC2671 (EDNS0). */ |
198 | int | 198 | int |
199 | res_opt(n0, buf, buflen, anslen) | 199 | res_opt(int n0, |
200 | int n0; | 200 | u_char *buf, /* buffer to put query */ |
201 | u_char *buf; /* buffer to put query */ | 201 | int buflen, /* size of buffer */ |
202 | int buflen; /* size of buffer */ | 202 | int anslen) /* answer buffer length */ |
203 | int anslen; /* answer buffer length */ | ||
204 | { | 203 | { |
205 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 204 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
206 | register HEADER *hp; | 205 | HEADER *hp; |
207 | register u_char *cp, *ep; | 206 | u_char *cp, *ep; |
208 | 207 | ||
209 | hp = (HEADER *) buf; | 208 | hp = (HEADER *) buf; |
210 | cp = buf + n0; | 209 | cp = buf + n0; |
diff --git a/src/lib/libc/net/res_query.c b/src/lib/libc/net/res_query.c index 3cdb7a7477..677c411a6e 100644 --- a/src/lib/libc/net/res_query.c +++ b/src/lib/libc/net/res_query.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: res_query.c,v 1.21 2003/06/02 20:18:36 millert Exp $ */ | 1 | /* $OpenBSD: res_query.c,v 1.22 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * ++Copyright++ 1988, 1993 | 4 | * ++Copyright++ 1988, 1993 |
@@ -56,7 +56,7 @@ | |||
56 | static char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93"; | 56 | static char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93"; |
57 | static char rcsid[] = "$From: res_query.c,v 8.9 1996/09/22 00:13:28 vixie Exp $"; | 57 | static char rcsid[] = "$From: res_query.c,v 8.9 1996/09/22 00:13:28 vixie Exp $"; |
58 | #else | 58 | #else |
59 | static char rcsid[] = "$OpenBSD: res_query.c,v 1.21 2003/06/02 20:18:36 millert Exp $"; | 59 | static char rcsid[] = "$OpenBSD: res_query.c,v 1.22 2005/03/25 13:24:12 otto Exp $"; |
60 | #endif | 60 | #endif |
61 | #endif /* LIBC_SCCS and not lint */ | 61 | #endif /* LIBC_SCCS and not lint */ |
62 | 62 | ||
@@ -98,15 +98,15 @@ extern int res_opt(int, u_char *, int, int); | |||
98 | * Caller must parse answer and determine whether it answers the question. | 98 | * Caller must parse answer and determine whether it answers the question. |
99 | */ | 99 | */ |
100 | int | 100 | int |
101 | res_query(name, class, type, answer, anslen) | 101 | res_query(const char *name, |
102 | const char *name; /* domain name */ | 102 | int class, /* domain name */ |
103 | int class, type; /* class and type of query */ | 103 | int type, /* class and type of query */ |
104 | u_char *answer; /* buffer to put answer */ | 104 | u_char *answer, /* buffer to put answer */ |
105 | int anslen; /* size of answer buffer */ | 105 | int anslen) /* size of answer buffer */ |
106 | { | 106 | { |
107 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 107 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
108 | u_char buf[MAXPACKET]; | 108 | u_char buf[MAXPACKET]; |
109 | register HEADER *hp = (HEADER *) answer; | 109 | HEADER *hp = (HEADER *) answer; |
110 | int n; | 110 | int n; |
111 | 111 | ||
112 | hp->rcode = NOERROR; /* default */ | 112 | hp->rcode = NOERROR; /* default */ |
@@ -180,13 +180,13 @@ res_query(name, class, type, answer, anslen) | |||
180 | * is detected. Error code, if any, is left in h_errno. | 180 | * is detected. Error code, if any, is left in h_errno. |
181 | */ | 181 | */ |
182 | int | 182 | int |
183 | res_search(name, class, type, answer, anslen) | 183 | res_search(const char *name, |
184 | const char *name; /* domain name */ | 184 | int class, /* domain name */ |
185 | int class, type; /* class and type of query */ | 185 | int type, /* class and type of query */ |
186 | u_char *answer; /* buffer to put answer */ | 186 | u_char *answer, /* buffer to put answer */ |
187 | int anslen; /* size of answer */ | 187 | int anslen) /* size of answer */ |
188 | { | 188 | { |
189 | register const char *cp, * const *domain; | 189 | const char *cp, * const *domain; |
190 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 190 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
191 | HEADER *hp = (HEADER *) answer; | 191 | HEADER *hp = (HEADER *) answer; |
192 | u_int dots; | 192 | u_int dots; |
@@ -320,11 +320,12 @@ res_search(name, class, type, answer, anslen) | |||
320 | * removing a trailing dot from name if domain is NULL. | 320 | * removing a trailing dot from name if domain is NULL. |
321 | */ | 321 | */ |
322 | int | 322 | int |
323 | res_querydomain(name, domain, class, type, answer, anslen) | 323 | res_querydomain(const char *name, |
324 | const char *name, *domain; | 324 | const char *domain, |
325 | int class, type; /* class and type of query */ | 325 | int class, /* class and type of query */ |
326 | u_char *answer; /* buffer to put answer */ | 326 | int type, |
327 | int anslen; /* size of answer */ | 327 | u_char *answer, /* buffer to put answer */ |
328 | int anslen) /* size of answer */ | ||
328 | { | 329 | { |
329 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 330 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
330 | char nbuf[MAXDNAME*2+1+1]; | 331 | char nbuf[MAXDNAME*2+1+1]; |
@@ -359,11 +360,10 @@ res_querydomain(name, domain, class, type, answer, anslen) | |||
359 | } | 360 | } |
360 | 361 | ||
361 | const char * | 362 | const char * |
362 | hostalias(name) | 363 | hostalias(const char *name) |
363 | register const char *name; | ||
364 | { | 364 | { |
365 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 365 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
366 | register char *cp1, *cp2; | 366 | char *cp1, *cp2; |
367 | FILE *fp; | 367 | FILE *fp; |
368 | char *file; | 368 | char *file; |
369 | char buf[BUFSIZ]; | 369 | char buf[BUFSIZ]; |
diff --git a/src/lib/libc/net/res_random.c b/src/lib/libc/net/res_random.c index b52330b3ee..4dc1d33462 100644 --- a/src/lib/libc/net/res_random.c +++ b/src/lib/libc/net/res_random.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: res_random.c,v 1.15 2003/12/12 06:57:12 itojun Exp $ */ | 1 | /* $OpenBSD: res_random.c,v 1.16 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> | 4 | * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> |
@@ -122,7 +122,7 @@ pmod(u_int16_t gen, u_int16_t exp, u_int16_t mod) | |||
122 | * application does not have to worry about it. | 122 | * application does not have to worry about it. |
123 | */ | 123 | */ |
124 | static void | 124 | static void |
125 | res_initid() | 125 | res_initid(void) |
126 | { | 126 | { |
127 | u_int16_t j, i; | 127 | u_int16_t j, i; |
128 | int noprime = 1; | 128 | int noprime = 1; |
@@ -173,7 +173,7 @@ res_initid() | |||
173 | } | 173 | } |
174 | 174 | ||
175 | u_int | 175 | u_int |
176 | res_randomid() | 176 | res_randomid(void) |
177 | { | 177 | { |
178 | int i, n; | 178 | int i, n; |
179 | 179 | ||
diff --git a/src/lib/libc/net/res_send.c b/src/lib/libc/net/res_send.c index 51fa777142..04eb268d90 100644 --- a/src/lib/libc/net/res_send.c +++ b/src/lib/libc/net/res_send.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: res_send.c,v 1.16 2004/11/17 01:42:26 itojun Exp $ */ | 1 | /* $OpenBSD: res_send.c,v 1.17 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * ++Copyright++ 1985, 1989, 1993 | 4 | * ++Copyright++ 1985, 1989, 1993 |
@@ -60,7 +60,7 @@ | |||
60 | static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93"; | 60 | static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93"; |
61 | static char rcsid[] = "$From: res_send.c,v 8.12 1996/10/08 04:51:06 vixie Exp $"; | 61 | static char rcsid[] = "$From: res_send.c,v 8.12 1996/10/08 04:51:06 vixie Exp $"; |
62 | #else | 62 | #else |
63 | static char rcsid[] = "$OpenBSD: res_send.c,v 1.16 2004/11/17 01:42:26 itojun Exp $"; | 63 | static char rcsid[] = "$OpenBSD: res_send.c,v 1.17 2005/03/25 13:24:12 otto Exp $"; |
64 | #endif | 64 | #endif |
65 | #endif /* LIBC_SCCS and not lint */ | 65 | #endif /* LIBC_SCCS and not lint */ |
66 | 66 | ||
@@ -128,11 +128,7 @@ static void Aerror(FILE *, char *, int, struct sockaddr *); | |||
128 | static void Perror(FILE *, char *, int); | 128 | static void Perror(FILE *, char *, int); |
129 | 129 | ||
130 | static void | 130 | static void |
131 | Aerror(file, string, error, address) | 131 | Aerror(FILE *file, char *string, int error, struct sockaddr *address) |
132 | FILE *file; | ||
133 | char *string; | ||
134 | int error; | ||
135 | struct sockaddr *address; | ||
136 | { | 132 | { |
137 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 133 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
138 | int save = errno; | 134 | int save = errno; |
@@ -149,10 +145,7 @@ static void Perror(FILE *, char *, int); | |||
149 | errno = save; | 145 | errno = save; |
150 | } | 146 | } |
151 | static void | 147 | static void |
152 | Perror(file, string, error) | 148 | Perror(FILE *file, char *string, int error) |
153 | FILE *file; | ||
154 | char *string; | ||
155 | int error; | ||
156 | { | 149 | { |
157 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 150 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
158 | int save = errno; | 151 | int save = errno; |
@@ -169,16 +162,14 @@ static res_send_qhook Qhook = NULL; | |||
169 | static res_send_rhook Rhook = NULL; | 162 | static res_send_rhook Rhook = NULL; |
170 | 163 | ||
171 | void | 164 | void |
172 | res_send_setqhook(hook) | 165 | res_send_setqhook(res_send_qhook hook) |
173 | res_send_qhook hook; | ||
174 | { | 166 | { |
175 | 167 | ||
176 | Qhook = hook; | 168 | Qhook = hook; |
177 | } | 169 | } |
178 | 170 | ||
179 | void | 171 | void |
180 | res_send_setrhook(hook) | 172 | res_send_setrhook(res_send_rhook hook) |
181 | res_send_rhook hook; | ||
182 | { | 173 | { |
183 | 174 | ||
184 | Rhook = hook; | 175 | Rhook = hook; |
@@ -191,8 +182,7 @@ static struct sockaddr * get_nsaddr(size_t); | |||
191 | * pick appropriate nsaddr_list for use. see res_init() for initialization. | 182 | * pick appropriate nsaddr_list for use. see res_init() for initialization. |
192 | */ | 183 | */ |
193 | static struct sockaddr * | 184 | static struct sockaddr * |
194 | get_nsaddr(n) | 185 | get_nsaddr(size_t n) |
195 | size_t n; | ||
196 | { | 186 | { |
197 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 187 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
198 | struct __res_state_ext *_res_extp = _THREAD_PRIVATE(_res_ext, _res_ext, | 188 | struct __res_state_ext *_res_extp = _THREAD_PRIVATE(_res_ext, _res_ext, |
@@ -228,8 +218,7 @@ get_nsaddr(n) | |||
228 | * paul vixie, 29may94 | 218 | * paul vixie, 29may94 |
229 | */ | 219 | */ |
230 | int | 220 | int |
231 | res_isourserver(inp) | 221 | res_isourserver(const struct sockaddr_in *inp) |
232 | const struct sockaddr_in *inp; | ||
233 | { | 222 | { |
234 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 223 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
235 | #ifdef INET6 | 224 | #ifdef INET6 |
@@ -284,17 +273,15 @@ res_isourserver(inp) | |||
284 | * paul vixie, 29may94 | 273 | * paul vixie, 29may94 |
285 | */ | 274 | */ |
286 | int | 275 | int |
287 | res_nameinquery(name, type, class, buf, eom) | 276 | res_nameinquery(const char *name, int type, int class, const u_char *buf, |
288 | const char *name; | 277 | const u_char *eom) |
289 | register int type, class; | ||
290 | const u_char *buf, *eom; | ||
291 | { | 278 | { |
292 | register const u_char *cp = buf + HFIXEDSZ; | 279 | const u_char *cp = buf + HFIXEDSZ; |
293 | int qdcount = ntohs(((HEADER*)buf)->qdcount); | 280 | int qdcount = ntohs(((HEADER*)buf)->qdcount); |
294 | 281 | ||
295 | while (qdcount-- > 0) { | 282 | while (qdcount-- > 0) { |
296 | char tname[MAXDNAME+1]; | 283 | char tname[MAXDNAME+1]; |
297 | register int n, ttype, tclass; | 284 | int n, ttype, tclass; |
298 | 285 | ||
299 | n = dn_expand(buf, eom, cp, tname, sizeof tname); | 286 | n = dn_expand(buf, eom, cp, tname, sizeof tname); |
300 | if (n < 0) | 287 | if (n < 0) |
@@ -322,18 +309,17 @@ res_nameinquery(name, type, class, buf, eom) | |||
322 | * paul vixie, 29may94 | 309 | * paul vixie, 29may94 |
323 | */ | 310 | */ |
324 | int | 311 | int |
325 | res_queriesmatch(buf1, eom1, buf2, eom2) | 312 | res_queriesmatch(const u_char *buf1, const u_char *eom1, const u_char *buf2, |
326 | const u_char *buf1, *eom1; | 313 | const u_char *eom2) |
327 | const u_char *buf2, *eom2; | ||
328 | { | 314 | { |
329 | register const u_char *cp = buf1 + HFIXEDSZ; | 315 | const u_char *cp = buf1 + HFIXEDSZ; |
330 | int qdcount = ntohs(((HEADER*)buf1)->qdcount); | 316 | int qdcount = ntohs(((HEADER*)buf1)->qdcount); |
331 | 317 | ||
332 | if (qdcount != ntohs(((HEADER*)buf2)->qdcount)) | 318 | if (qdcount != ntohs(((HEADER*)buf2)->qdcount)) |
333 | return (0); | 319 | return (0); |
334 | while (qdcount-- > 0) { | 320 | while (qdcount-- > 0) { |
335 | char tname[MAXDNAME+1]; | 321 | char tname[MAXDNAME+1]; |
336 | register int n, ttype, tclass; | 322 | int n, ttype, tclass; |
337 | 323 | ||
338 | n = dn_expand(buf1, eom1, cp, tname, sizeof tname); | 324 | n = dn_expand(buf1, eom1, cp, tname, sizeof tname); |
339 | if (n < 0) | 325 | if (n < 0) |
@@ -348,17 +334,13 @@ res_queriesmatch(buf1, eom1, buf2, eom2) | |||
348 | } | 334 | } |
349 | 335 | ||
350 | int | 336 | int |
351 | res_send(buf, buflen, ans, anssiz) | 337 | res_send(const u_char *buf, int buflen, u_char *ans, int anssiz) |
352 | const u_char *buf; | ||
353 | int buflen; | ||
354 | u_char *ans; | ||
355 | int anssiz; | ||
356 | { | 338 | { |
357 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 339 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
358 | HEADER *hp = (HEADER *) buf; | 340 | HEADER *hp = (HEADER *) buf; |
359 | HEADER *anhp = (HEADER *) ans; | 341 | HEADER *anhp = (HEADER *) ans; |
360 | int gotsomewhere, connreset, terrno, try, v_circuit, resplen, ns; | 342 | int gotsomewhere, connreset, terrno, try, v_circuit, resplen, ns; |
361 | register int n; | 343 | int n; |
362 | u_int badns; /* XXX NSMAX can't exceed #/bits in this var */ | 344 | u_int badns; /* XXX NSMAX can't exceed #/bits in this var */ |
363 | 345 | ||
364 | if ((_resp->options & RES_INIT) == 0 && res_init() == -1) { | 346 | if ((_resp->options & RES_INIT) == 0 && res_init() == -1) { |
@@ -885,7 +867,7 @@ read_len: | |||
885 | * This routine is not expected to be user visible. | 867 | * This routine is not expected to be user visible. |
886 | */ | 868 | */ |
887 | void | 869 | void |
888 | res_close() | 870 | res_close(void) |
889 | { | 871 | { |
890 | if (s >= 0) { | 872 | if (s >= 0) { |
891 | (void) close(s); | 873 | (void) close(s); |
diff --git a/src/lib/libc/net/rresvport.c b/src/lib/libc/net/rresvport.c index 6e4698e3be..eee872898b 100644 --- a/src/lib/libc/net/rresvport.c +++ b/src/lib/libc/net/rresvport.c | |||
@@ -29,7 +29,7 @@ | |||
29 | */ | 29 | */ |
30 | 30 | ||
31 | #if defined(LIBC_SCCS) && !defined(lint) | 31 | #if defined(LIBC_SCCS) && !defined(lint) |
32 | static char *rcsid = "$OpenBSD: rresvport.c,v 1.6 2003/06/03 02:11:35 deraadt Exp $"; | 32 | static char *rcsid = "$OpenBSD: rresvport.c,v 1.7 2005/03/25 13:24:12 otto Exp $"; |
33 | #endif /* LIBC_SCCS and not lint */ | 33 | #endif /* LIBC_SCCS and not lint */ |
34 | 34 | ||
35 | #include <sys/param.h> | 35 | #include <sys/param.h> |
@@ -53,17 +53,14 @@ static char *rcsid = "$OpenBSD: rresvport.c,v 1.6 2003/06/03 02:11:35 deraadt Ex | |||
53 | #include <netgroup.h> | 53 | #include <netgroup.h> |
54 | 54 | ||
55 | int | 55 | int |
56 | rresvport(alport) | 56 | rresvport(int *alport) |
57 | int *alport; | ||
58 | { | 57 | { |
59 | return rresvport_af(alport, AF_INET); | 58 | return rresvport_af(alport, AF_INET); |
60 | } | 59 | } |
61 | 60 | ||
62 | 61 | ||
63 | int | 62 | int |
64 | rresvport_af(alport, af) | 63 | rresvport_af(int *alport, int af) |
65 | int *alport; | ||
66 | int af; | ||
67 | { | 64 | { |
68 | struct sockaddr_storage ss; | 65 | struct sockaddr_storage ss; |
69 | struct sockaddr *sa; | 66 | struct sockaddr *sa; |
diff --git a/src/lib/libc/net/rthdr.c b/src/lib/libc/net/rthdr.c index 366ca9e6ba..36ac5a3554 100644 --- a/src/lib/libc/net/rthdr.c +++ b/src/lib/libc/net/rthdr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rthdr.c,v 1.6 2003/06/11 02:54:02 itojun Exp $ */ | 1 | /* $OpenBSD: rthdr.c,v 1.7 2005/03/25 13:24:12 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. | 4 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. |
@@ -40,8 +40,7 @@ | |||
40 | #include <stdio.h> | 40 | #include <stdio.h> |
41 | 41 | ||
42 | size_t | 42 | size_t |
43 | inet6_rthdr_space(type, seg) | 43 | inet6_rthdr_space(int type, int seg) |
44 | int type, seg; | ||
45 | { | 44 | { |
46 | switch (type) { | 45 | switch (type) { |
47 | case IPV6_RTHDR_TYPE_0: | 46 | case IPV6_RTHDR_TYPE_0: |
@@ -55,9 +54,7 @@ inet6_rthdr_space(type, seg) | |||
55 | } | 54 | } |
56 | 55 | ||
57 | struct cmsghdr * | 56 | struct cmsghdr * |
58 | inet6_rthdr_init(bp, type) | 57 | inet6_rthdr_init(void *bp, int type) |
59 | void *bp; | ||
60 | int type; | ||
61 | { | 58 | { |
62 | struct cmsghdr *ch = (struct cmsghdr *)bp; | 59 | struct cmsghdr *ch = (struct cmsghdr *)bp; |
63 | struct ip6_rthdr *rthdr; | 60 | struct ip6_rthdr *rthdr; |
@@ -79,10 +76,7 @@ inet6_rthdr_init(bp, type) | |||
79 | } | 76 | } |
80 | 77 | ||
81 | int | 78 | int |
82 | inet6_rthdr_add(cmsg, addr, flags) | 79 | inet6_rthdr_add(struct cmsghdr *cmsg, const struct in6_addr *addr, u_int flags) |
83 | struct cmsghdr *cmsg; | ||
84 | const struct in6_addr *addr; | ||
85 | u_int flags; | ||
86 | { | 80 | { |
87 | struct ip6_rthdr *rthdr; | 81 | struct ip6_rthdr *rthdr; |
88 | 82 | ||
@@ -111,9 +105,7 @@ inet6_rthdr_add(cmsg, addr, flags) | |||
111 | } | 105 | } |
112 | 106 | ||
113 | int | 107 | int |
114 | inet6_rthdr_lasthop(cmsg, flags) | 108 | inet6_rthdr_lasthop(struct cmsghdr *cmsg, unsigned int flags) |
115 | struct cmsghdr *cmsg; | ||
116 | unsigned int flags; | ||
117 | { | 109 | { |
118 | struct ip6_rthdr *rthdr; | 110 | struct ip6_rthdr *rthdr; |
119 | 111 | ||
@@ -148,8 +140,7 @@ inet6_rthdr_reverse(in, out) | |||
148 | #endif | 140 | #endif |
149 | 141 | ||
150 | int | 142 | int |
151 | inet6_rthdr_segments(cmsg) | 143 | inet6_rthdr_segments(const struct cmsghdr *cmsg) |
152 | const struct cmsghdr *cmsg; | ||
153 | { | 144 | { |
154 | struct ip6_rthdr *rthdr; | 145 | struct ip6_rthdr *rthdr; |
155 | 146 | ||
@@ -172,9 +163,7 @@ inet6_rthdr_segments(cmsg) | |||
172 | } | 163 | } |
173 | 164 | ||
174 | struct in6_addr * | 165 | struct in6_addr * |
175 | inet6_rthdr_getaddr(cmsg, index) | 166 | inet6_rthdr_getaddr(struct cmsghdr *cmsg, int index) |
176 | struct cmsghdr *cmsg; | ||
177 | int index; | ||
178 | { | 167 | { |
179 | struct ip6_rthdr *rthdr; | 168 | struct ip6_rthdr *rthdr; |
180 | 169 | ||
@@ -200,9 +189,7 @@ inet6_rthdr_getaddr(cmsg, index) | |||
200 | } | 189 | } |
201 | 190 | ||
202 | int | 191 | int |
203 | inet6_rthdr_getflags(cmsg, index) | 192 | inet6_rthdr_getflags(const struct cmsghdr *cmsg, int index) |
204 | const struct cmsghdr *cmsg; | ||
205 | int index; | ||
206 | { | 193 | { |
207 | struct ip6_rthdr *rthdr; | 194 | struct ip6_rthdr *rthdr; |
208 | 195 | ||
diff --git a/src/lib/libc/net/send.c b/src/lib/libc/net/send.c index 8a7cc74e2d..f28933369c 100644 --- a/src/lib/libc/net/send.c +++ b/src/lib/libc/net/send.c | |||
@@ -28,7 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #if defined(LIBC_SCCS) && !defined(lint) | 30 | #if defined(LIBC_SCCS) && !defined(lint) |
31 | static char rcsid[] = "$OpenBSD: send.c,v 1.3 2003/06/02 20:18:36 millert Exp $"; | 31 | static char rcsid[] = "$OpenBSD: send.c,v 1.4 2005/03/25 13:24:12 otto Exp $"; |
32 | #endif /* LIBC_SCCS and not lint */ | 32 | #endif /* LIBC_SCCS and not lint */ |
33 | 33 | ||
34 | #include <sys/types.h> | 34 | #include <sys/types.h> |
@@ -37,10 +37,7 @@ static char rcsid[] = "$OpenBSD: send.c,v 1.3 2003/06/02 20:18:36 millert Exp $" | |||
37 | #include <stddef.h> | 37 | #include <stddef.h> |
38 | 38 | ||
39 | ssize_t | 39 | ssize_t |
40 | send(s, msg, len, flags) | 40 | send(int s, const void *msg, size_t len, int flags) |
41 | int s, flags; | ||
42 | size_t len; | ||
43 | const void *msg; | ||
44 | { | 41 | { |
45 | return (sendto(s, msg, len, flags, NULL, 0)); | 42 | return (sendto(s, msg, len, flags, NULL, 0)); |
46 | } | 43 | } |
diff --git a/src/lib/libc/net/sethostent.c b/src/lib/libc/net/sethostent.c index 2a8df101d4..2140d65d08 100644 --- a/src/lib/libc/net/sethostent.c +++ b/src/lib/libc/net/sethostent.c | |||
@@ -28,7 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #if defined(LIBC_SCCS) && !defined(lint) | 30 | #if defined(LIBC_SCCS) && !defined(lint) |
31 | static char rcsid[] = "$OpenBSD: sethostent.c,v 1.6 2003/06/02 20:18:36 millert Exp $"; | 31 | static char rcsid[] = "$OpenBSD: sethostent.c,v 1.7 2005/03/25 13:24:12 otto Exp $"; |
32 | #endif /* LIBC_SCCS and not lint */ | 32 | #endif /* LIBC_SCCS and not lint */ |
33 | 33 | ||
34 | #include <sys/param.h> | 34 | #include <sys/param.h> |
@@ -40,8 +40,7 @@ static char rcsid[] = "$OpenBSD: sethostent.c,v 1.6 2003/06/02 20:18:36 millert | |||
40 | #include "thread_private.h" | 40 | #include "thread_private.h" |
41 | 41 | ||
42 | void | 42 | void |
43 | sethostent(stayopen) | 43 | sethostent(int stayopen) |
44 | int stayopen; | ||
45 | { | 44 | { |
46 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 45 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
47 | 46 | ||
@@ -52,7 +51,7 @@ sethostent(stayopen) | |||
52 | } | 51 | } |
53 | 52 | ||
54 | void | 53 | void |
55 | endhostent() | 54 | endhostent(void) |
56 | { | 55 | { |
57 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 56 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |
58 | 57 | ||