diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2005-03-25 13:24:13 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2005-03-25 13:24:13 +0000 |
commit | 367caa05f7f8d7687477fb03be7607b79e055127 (patch) | |
tree | 61380116a34433b437ea9412277e0cf044dce992 /lib | |
parent | ad418525c7ffd9248e6cc7a6aa70d5fbfa124ff5 (diff) |
ansify. ok deraadt@ moritz@
Diffstat (limited to 'lib')
43 files changed, 348 insertions, 665 deletions
diff --git a/lib/libc/net/ethers.c b/lib/libc/net/ethers.c index 2c1e562245b..0a86a30af20 100644 --- a/lib/libc/net/ethers.c +++ b/lib/libc/net/ethers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ethers.c,v 1.17 2004/02/16 19:41:12 otto Exp $ */ +/* $OpenBSD: ethers.c,v 1.18 2005/03/25 13:24:11 otto Exp $ */ /* * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> @@ -23,7 +23,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: ethers.c,v 1.17 2004/02/16 19:41:12 otto Exp $"; +static char rcsid[] = "$OpenBSD: ethers.c,v 1.18 2005/03/25 13:24:11 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #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 $" static char * _ether_aton(char *, struct ether_addr *); char * -ether_ntoa(e) - struct ether_addr *e; +ether_ntoa(struct ether_addr *e) { static char a[] = "xx:xx:xx:xx:xx:xx"; @@ -63,9 +62,7 @@ ether_ntoa(e) } static char * -_ether_aton(s, e) - char *s; - struct ether_addr *e; +_ether_aton(char *s, struct ether_addr *e) { int i; long l; @@ -90,8 +87,7 @@ _ether_aton(s, e) } struct ether_addr * -ether_aton(s) - char *s; +ether_aton(char *s) { static struct ether_addr n; @@ -99,9 +95,7 @@ ether_aton(s) } int -ether_ntohost(hostname, e) - char *hostname; - struct ether_addr *e; +ether_ntohost(char *hostname, struct ether_addr *e) { FILE *f; char buf[BUFSIZ+1], *p; @@ -163,9 +157,7 @@ ether_ntohost(hostname, e) } int -ether_hostton(hostname, e) - char *hostname; - struct ether_addr *e; +ether_hostton(char *hostname, struct ether_addr *e) { FILE *f; char buf[BUFSIZ+1], *p; @@ -218,10 +210,7 @@ ether_hostton(hostname, e) } int -ether_line(line, e, hostname) - char *line; - struct ether_addr *e; - char *hostname; +ether_line(char *line, struct ether_addr *e, char *hostname) { char *p; size_t n; diff --git a/lib/libc/net/freeaddrinfo.c b/lib/libc/net/freeaddrinfo.c index ebbc2492df9..58702d0b187 100644 --- a/lib/libc/net/freeaddrinfo.c +++ b/lib/libc/net/freeaddrinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: freeaddrinfo.c,v 1.5 2004/10/01 04:08:45 jsg Exp $ */ +/* $OpenBSD: freeaddrinfo.c,v 1.6 2005/03/25 13:24:11 otto Exp $ */ /* * Copyright (c) 1996, 1997, 1998, 1999, Craig Metz, All rights reserved. @@ -36,8 +36,7 @@ #include <netdb.h> void -freeaddrinfo(ai) - struct addrinfo *ai; +freeaddrinfo(struct addrinfo *ai) { struct addrinfo *p; diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c index 3db8cc82ee9..c7cc0500c33 100644 --- a/lib/libc/net/getaddrinfo.c +++ b/lib/libc/net/getaddrinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getaddrinfo.c,v 1.50 2004/06/07 21:11:23 marc Exp $ */ +/* $OpenBSD: getaddrinfo.c,v 1.51 2005/03/25 13:24:12 otto Exp $ */ /* $KAME: getaddrinfo.c,v 1.31 2000/08/31 17:36:43 itojun Exp $ */ /* @@ -279,8 +279,7 @@ do { \ ((x) == (y) || (/*CONSTCOND*/(w) && ((x) == ANY || (y) == ANY))) static int -str2number(p) - const char *p; +str2number(const char *p) { char *ep; unsigned long v; @@ -297,10 +296,8 @@ str2number(p) } int -getaddrinfo(hostname, servname, hints, res) - const char *hostname, *servname; - const struct addrinfo *hints; - struct addrinfo **res; +getaddrinfo(const char *hostname, const char *servname, + const struct addrinfo *hints, struct addrinfo **res) { struct addrinfo sentinel; struct addrinfo *cur; @@ -499,11 +496,8 @@ getaddrinfo(hostname, servname, hints, res) */ static int -explore_fqdn(pai, hostname, servname, res) - const struct addrinfo *pai; - const char *hostname; - const char *servname; - struct addrinfo **res; +explore_fqdn(const struct addrinfo *pai, const char *hostname, + const char *servname, struct addrinfo **res) { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); struct addrinfo *result; @@ -597,10 +591,8 @@ free: * non-passive socket -> localhost (127.0.0.1 or ::1) */ static int -explore_null(pai, servname, res) - const struct addrinfo *pai; - const char *servname; - struct addrinfo **res; +explore_null(const struct addrinfo *pai, const char *servname, + struct addrinfo **res) { int s; const struct afd *afd; @@ -661,12 +653,8 @@ free: * numeric hostname */ static int -explore_numeric(pai, hostname, servname, res, canonname) - const struct addrinfo *pai; - const char *hostname; - const char *servname; - struct addrinfo **res; - const char *canonname; +explore_numeric(const struct addrinfo *pai, const char *hostname, + const char *servname, struct addrinfo **res, const char *canonname) { const struct afd *afd; struct addrinfo *cur; @@ -747,11 +735,8 @@ bad: * numeric hostname with scope */ static int -explore_numeric_scope(pai, hostname, servname, res) - const struct addrinfo *pai; - const char *hostname; - const char *servname; - struct addrinfo **res; +explore_numeric_scope(const struct addrinfo *pai, const char *hostname, + const char *servname, struct addrinfo **res) { #if !defined(SCOPE_DELIMITER) || !defined(INET6) return explore_numeric(pai, hostname, servname, res, hostname); @@ -813,10 +798,7 @@ explore_numeric_scope(pai, hostname, servname, res) } static int -get_canonname(pai, ai, str) - const struct addrinfo *pai; - struct addrinfo *ai; - const char *str; +get_canonname(const struct addrinfo *pai, struct addrinfo *ai, const char *str) { if ((pai->ai_flags & AI_CANONNAME) != 0) { ai->ai_canonname = strdup(str); @@ -827,10 +809,7 @@ get_canonname(pai, ai, str) } static struct addrinfo * -get_ai(pai, afd, addr) - const struct addrinfo *pai; - const struct afd *afd; - const char *addr; +get_ai(const struct addrinfo *pai, const struct afd *afd, const char *addr) { char *p; struct addrinfo *ai; @@ -852,9 +831,7 @@ get_ai(pai, afd, addr) } static int -get_portmatch(ai, servname) - const struct addrinfo *ai; - const char *servname; +get_portmatch(const struct addrinfo *ai, const char *servname) { /* get_port does not touch first argument. when matchonly == 1. */ @@ -863,10 +840,7 @@ get_portmatch(ai, servname) } static int -get_port(ai, servname, matchonly) - struct addrinfo *ai; - const char *servname; - int matchonly; +get_port(struct addrinfo *ai, const char *servname, int matchonly) { const char *proto; struct servent *sp; @@ -951,8 +925,7 @@ get_port(ai, servname, matchonly) } static const struct afd * -find_afd(af) - int af; +find_afd(int af) { const struct afd *afd; @@ -968,10 +941,7 @@ find_afd(af) #ifdef INET6 /* convert a string to a scope identifier. XXX: IPv6 specific */ static int -ip6_str2scopeid(scope, sin6, scopeid) - char *scope; - struct sockaddr_in6 *sin6; - u_int32_t *scopeid; +ip6_str2scopeid(char *scope, struct sockaddr_in6 *sin6, u_int32_t *scopeid) { u_long lscopeid; struct in6_addr *a6 = &sin6->sin6_addr; @@ -1020,12 +990,8 @@ static const char AskedForGot[] = static FILE *hostf = NULL; static struct addrinfo * -getanswer(answer, anslen, qname, qtype, pai) - const querybuf *answer; - int anslen; - const char *qname; - int qtype; - const struct addrinfo *pai; +getanswer(const querybuf *answer, int anslen, const char *qname, int qtype, + const struct addrinfo *pai) { struct addrinfo sentinel, *cur; struct addrinfo ai; @@ -1212,9 +1178,7 @@ getanswer(answer, anslen, qname, qtype, pai) /*ARGSUSED*/ static struct addrinfo * -_dns_getaddrinfo(name, pai) - const char *name; - const struct addrinfo *pai; +_dns_getaddrinfo(const char *name, const struct addrinfo *pai) { struct addrinfo *ai; querybuf *buf, *buf2; @@ -1292,7 +1256,7 @@ _dns_getaddrinfo(name, pai) static FILE *hostf; static void -_sethtent() +_sethtent(void) { if (!hostf) hostf = fopen(_PATH_HOSTS, "r" ); @@ -1301,7 +1265,7 @@ _sethtent() } static void -_endhtent() +_endhtent(void) { if (hostf) { (void) fclose(hostf); @@ -1310,9 +1274,7 @@ _endhtent() } static struct addrinfo * -_gethtent(name, pai) - const char *name; - const struct addrinfo *pai; +_gethtent(const char *name, const struct addrinfo *pai) { char *p; char *cp, *tname, *cname; @@ -1374,9 +1336,7 @@ found: /*ARGSUSED*/ static struct addrinfo * -_files_getaddrinfo(name, pai) - const char *name; - const struct addrinfo *pai; +_files_getaddrinfo(const char *name, const struct addrinfo *pai) { struct addrinfo sentinel, *cur; struct addrinfo *p; @@ -1400,9 +1360,7 @@ static char *__ypdomain; /*ARGSUSED*/ static struct addrinfo * -_yphostent(line, pai) - char *line; - const struct addrinfo *pai; +_yphostent(char *line, const struct addrinfo *pai) { struct addrinfo sentinel, *cur; struct addrinfo hints, *res, *res0; @@ -1478,9 +1436,7 @@ done: /*ARGSUSED*/ static struct addrinfo * -_yp_getaddrinfo(name, pai) - const char *name; - const struct addrinfo *pai; +_yp_getaddrinfo(const char *name, const struct addrinfo *pai) { struct addrinfo sentinel, *cur; struct addrinfo *ai = NULL; @@ -1550,9 +1506,7 @@ extern int res_opt(int, u_char *, int, int); * Caller must parse answer and determine whether it answers the question. */ static int -res_queryN(name, target) - const char *name; /* domain name */ - struct res_target *target; +res_queryN(const char *name, struct res_target *target) { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); u_char *buf; @@ -1668,9 +1622,7 @@ res_queryN(name, target) * is detected. Error code, if any, is left in h_errno. */ static int -res_searchN(name, target) - const char *name; /* domain name */ - struct res_target *target; +res_searchN(const char *name, struct res_target *target) { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); const char *cp, * const *domain; @@ -1808,9 +1760,8 @@ res_searchN(name, target) * removing a trailing dot from name if domain is NULL. */ static int -res_querydomainN(name, domain, target) - const char *name, *domain; - struct res_target *target; +res_querydomainN(const char *name, const char *domain, + struct res_target *target) { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); char nbuf[MAXDNAME]; diff --git a/lib/libc/net/getnameinfo.c b/lib/libc/net/getnameinfo.c index 8681137fd75..830a94279e1 100644 --- a/lib/libc/net/getnameinfo.c +++ b/lib/libc/net/getnameinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getnameinfo.c,v 1.29 2004/09/15 19:01:28 deraadt Exp $ */ +/* $OpenBSD: getnameinfo.c,v 1.30 2005/03/25 13:24:12 otto Exp $ */ /* $KAME: getnameinfo.c,v 1.45 2000/09/25 22:43:56 itojun Exp $ */ /* @@ -94,14 +94,8 @@ static int ip6_sa2str(const struct sockaddr_in6 *, char *, size_t, int); void *__THREAD_NAME(serv_mutex); int -getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) - const struct sockaddr *sa; - socklen_t salen; - char *host; - size_t hostlen; - char *serv; - size_t servlen; - int flags; +getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, + size_t hostlen, char *serv, size_t servlen, int flags) { const struct afd *afd; struct servent *sp; @@ -286,12 +280,8 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) #ifdef INET6 static int -ip6_parsenumeric(sa, addr, host, hostlen, flags) - const struct sockaddr *sa; - const char *addr; - char *host; - size_t hostlen; - int flags; +ip6_parsenumeric(const struct sockaddr *sa, const char *addr, char *host, + size_t hostlen, int flags) { int numaddrlen; char numaddr[512]; @@ -328,11 +318,7 @@ ip6_parsenumeric(sa, addr, host, hostlen, flags) /* ARGSUSED */ static int -ip6_sa2str(sa6, buf, bufsiz, flags) - const struct sockaddr_in6 *sa6; - char *buf; - size_t bufsiz; - int flags; +ip6_sa2str(const struct sockaddr_in6 *sa6, char *buf, size_t bufsiz, int flags) { unsigned int ifindex; const struct in6_addr *a6; diff --git a/lib/libc/net/getnetbyaddr.c b/lib/libc/net/getnetbyaddr.c index 29365d4735f..82d1ea1dcaa 100644 --- a/lib/libc/net/getnetbyaddr.c +++ b/lib/libc/net/getnetbyaddr.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: getnetbyaddr.c,v 1.6 2003/06/02 20:18:35 millert Exp $"; +static char rcsid[] = "$OpenBSD: getnetbyaddr.c,v 1.7 2005/03/25 13:24:12 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <netdb.h> @@ -36,11 +36,9 @@ static char rcsid[] = "$OpenBSD: getnetbyaddr.c,v 1.6 2003/06/02 20:18:35 miller extern int _net_stayopen; struct netent * -_getnetbyaddr(net, type) - register in_addr_t net; - register int type; +_getnetbyaddr(in_addr_t net, int type) { - register struct netent *p; + struct netent *p; setnetent(_net_stayopen); while ((p = getnetent())) diff --git a/lib/libc/net/getnetbyname.c b/lib/libc/net/getnetbyname.c index 04ab7b63324..83b3ca3817a 100644 --- a/lib/libc/net/getnetbyname.c +++ b/lib/libc/net/getnetbyname.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: getnetbyname.c,v 1.6 2003/06/02 20:18:35 millert Exp $"; +static char rcsid[] = "$OpenBSD: getnetbyname.c,v 1.7 2005/03/25 13:24:12 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <netdb.h> @@ -37,11 +37,10 @@ static char rcsid[] = "$OpenBSD: getnetbyname.c,v 1.6 2003/06/02 20:18:35 miller extern int _net_stayopen; struct netent * -_getnetbyname(name) - register const char *name; +_getnetbyname(const char *name) { - register struct netent *p; - register char **cp; + struct netent *p; + char **cp; setnetent(_net_stayopen); while ((p = getnetent())) { diff --git a/lib/libc/net/getnetent.c b/lib/libc/net/getnetent.c index 4c3b38e7d8d..3e52c1ff4d5 100644 --- a/lib/libc/net/getnetent.c +++ b/lib/libc/net/getnetent.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: getnetent.c,v 1.9 2003/06/02 20:18:35 millert Exp $"; +static char rcsid[] = "$OpenBSD: getnetent.c,v 1.10 2005/03/25 13:24:12 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -48,8 +48,7 @@ static char *net_aliases[MAXALIASES]; int _net_stayopen; void -setnetent(f) - int f; +setnetent(int f) { if (netf == NULL) netf = fopen(_PATH_NETWORKS, "r" ); @@ -59,7 +58,7 @@ setnetent(f) } void -endnetent() +endnetent(void) { if (netf) { fclose(netf); @@ -69,7 +68,7 @@ endnetent() } struct netent * -getnetent() +getnetent(void) { char *p, *cp, **q; size_t len; diff --git a/lib/libc/net/getnetnamadr.c b/lib/libc/net/getnetnamadr.c index 149216ffd8b..42410264b13 100644 --- a/lib/libc/net/getnetnamadr.c +++ b/lib/libc/net/getnetnamadr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getnetnamadr.c,v 1.23 2003/06/03 21:09:00 deraadt Exp $ */ +/* $OpenBSD: getnetnamadr.c,v 1.24 2005/03/25 13:24:12 otto Exp $ */ /* * Copyright (c) 1997, Jason Downs. All rights reserved. @@ -66,7 +66,7 @@ static char sccsid[] = "@(#)getnetbyaddr.c 8.1 (Berkeley) 6/4/93"; static char sccsid_[] = "from getnetnamadr.c 1.4 (Coimbra) 93/06/03"; static char rcsid[] = "$From: getnetnamadr.c,v 8.7 1996/08/05 08:31:35 vixie Exp $"; #else -static char rcsid[] = "$OpenBSD: getnetnamadr.c,v 1.23 2003/06/03 21:09:00 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: getnetnamadr.c,v 1.24 2005/03/25 13:24:12 otto Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -111,15 +111,12 @@ typedef union { } align; static struct netent * -getnetanswer(answer, anslen, net_i) - querybuf *answer; - int anslen; - int net_i; +getnetanswer(querybuf *answer, int anslen, int net_i) { - register HEADER *hp; - register u_char *cp; - register int n; + HEADER *hp; + u_char *cp; + int n; u_char *eom; int type, class, ancount, qdcount, haveanswer, i, nchar; char aux1[MAXHOSTNAMELEN], aux2[MAXHOSTNAMELEN], ans[MAXHOSTNAMELEN]; @@ -250,9 +247,7 @@ getnetanswer(answer, anslen, net_i) } struct netent * -getnetbyaddr(net, net_type) - register in_addr_t net; - register int net_type; +getnetbyaddr(in_addr_t net, int net_type) { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); unsigned int netbr[4]; @@ -342,8 +337,7 @@ getnetbyaddr(net, net_type) } struct netent * -getnetbyname(net) - register const char *net; +getnetbyname(const char *net) { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); int anslen; diff --git a/lib/libc/net/getrrsetbyname.c b/lib/libc/net/getrrsetbyname.c index 60610e49432..dcfc86a6918 100644 --- a/lib/libc/net/getrrsetbyname.c +++ b/lib/libc/net/getrrsetbyname.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getrrsetbyname.c,v 1.8 2004/07/18 19:07:38 jakob Exp $ */ +/* $OpenBSD: getrrsetbyname.c,v 1.9 2005/03/25 13:24:12 otto Exp $ */ /* * 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) } static struct dns_rr * -parse_dns_rrsection(const u_char *answer, int size, const u_char **cp, int count) +parse_dns_rrsection(const u_char *answer, int size, const u_char **cp, + int count) { struct dns_rr *head, *curr, *prev; int i, length; diff --git a/lib/libc/net/herror.c b/lib/libc/net/herror.c index 64d4d55486e..c1e5a4ba56e 100644 --- a/lib/libc/net/herror.c +++ b/lib/libc/net/herror.c @@ -1,4 +1,4 @@ -/* $OpenBSD: herror.c,v 1.6 2005/03/02 12:26:24 millert Exp $ */ +/* $OpenBSD: herror.c,v 1.7 2005/03/25 13:24:12 otto Exp $ */ /* * ++Copyright++ 1987, 1993 @@ -56,7 +56,7 @@ static char sccsid[] = "@(#)herror.c 8.1 (Berkeley) 6/4/93"; static char rcsid[] = "$From: herror.c,v 8.3 1996/08/05 08:31:35 vixie Exp $"; #else -static char rcsid[] = "$OpenBSD: herror.c,v 1.6 2005/03/02 12:26:24 millert Exp $"; +static char rcsid[] = "$OpenBSD: herror.c,v 1.7 2005/03/25 13:24:12 otto Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -83,11 +83,10 @@ extern int h_errno; * print the error indicated by the h_errno value. */ void -herror(s) - const char *s; +herror(const char *s) { struct iovec iov[4]; - register struct iovec *v = iov; + struct iovec *v = iov; if (s && *s) { v->iov_base = (char *)s; @@ -106,8 +105,7 @@ herror(s) } const char * -hstrerror(err) - int err; +hstrerror(int err) { if (err < 0) return ("Resolver internal error"); diff --git a/lib/libc/net/htonl.c b/lib/libc/net/htonl.c index 73b74327317..f104e190a2d 100644 --- a/lib/libc/net/htonl.c +++ b/lib/libc/net/htonl.c @@ -4,7 +4,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: htonl.c,v 1.4 1996/12/12 03:19:55 tholo Exp $"; +static char *rcsid = "$OpenBSD: htonl.c,v 1.5 2005/03/25 13:24:12 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #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 $"; #undef htonl u_int32_t -htonl(x) - u_int32_t x; +htonl(u_int32_t x) { #if BYTE_ORDER == LITTLE_ENDIAN u_char *s = (u_char *)&x; diff --git a/lib/libc/net/inet_addr.c b/lib/libc/net/inet_addr.c index 716dcb6f801..b55983fd813 100644 --- a/lib/libc/net/inet_addr.c +++ b/lib/libc/net/inet_addr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet_addr.c,v 1.7 2003/06/02 20:18:35 millert Exp $ */ +/* $OpenBSD: inet_addr.c,v 1.8 2005/03/25 13:24:12 otto Exp $ */ /* * ++Copyright++ 1983, 1990, 1993 @@ -56,7 +56,7 @@ static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93"; static char rcsid[] = "$From: inet_addr.c,v 8.5 1996/08/05 08:31:35 vixie Exp $"; #else -static char rcsid[] = "$OpenBSD: inet_addr.c,v 1.7 2003/06/02 20:18:35 millert Exp $"; +static char rcsid[] = "$OpenBSD: inet_addr.c,v 1.8 2005/03/25 13:24:12 otto Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -71,8 +71,7 @@ static char rcsid[] = "$OpenBSD: inet_addr.c,v 1.7 2003/06/02 20:18:35 millert E * The value returned is in network order. */ in_addr_t -inet_addr(cp) - register const char *cp; +inet_addr(const char *cp) { struct in_addr val; @@ -89,15 +88,13 @@ inet_addr(cp) * cannot distinguish between failure and a local broadcast address. */ int -inet_aton(cp, addr) - register const char *cp; - struct in_addr *addr; +inet_aton(const char *cp, struct in_addr *addr) { - register in_addr_t val; - register int base, n; - register char c; + in_addr_t val; + int base, n; + char c; u_int parts[4]; - register u_int *pp = parts; + u_int *pp = parts; c = *cp; for (;;) { diff --git a/lib/libc/net/inet_lnaof.c b/lib/libc/net/inet_lnaof.c index c1e9780cdaf..110828b2f60 100644 --- a/lib/libc/net/inet_lnaof.c +++ b/lib/libc/net/inet_lnaof.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: inet_lnaof.c,v 1.4 2003/06/02 20:18:35 millert Exp $"; +static char rcsid[] = "$OpenBSD: inet_lnaof.c,v 1.5 2005/03/25 13:24:12 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #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 * number formats. */ in_addr_t -inet_lnaof(in) - struct in_addr in; +inet_lnaof(struct in_addr in) { - register in_addr_t i = ntohl(in.s_addr); + in_addr_t i = ntohl(in.s_addr); if (IN_CLASSA(i)) return ((i)&IN_CLASSA_HOST); diff --git a/lib/libc/net/inet_makeaddr.c b/lib/libc/net/inet_makeaddr.c index a6b59707faa..9a15da8fec3 100644 --- a/lib/libc/net/inet_makeaddr.c +++ b/lib/libc/net/inet_makeaddr.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: inet_makeaddr.c,v 1.4 2003/06/02 20:18:35 millert Exp $"; +static char rcsid[] = "$OpenBSD: inet_makeaddr.c,v 1.5 2005/03/25 13:24:12 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #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 * building addresses stored in the ifnet structure. */ struct in_addr -inet_makeaddr(net, host) - in_addr_t net, host; +inet_makeaddr(in_addr_t net, in_addr_t host) { in_addr_t addr; diff --git a/lib/libc/net/inet_net_ntop.c b/lib/libc/net/inet_net_ntop.c index 2b7de0cec35..38978f3ccf1 100644 --- a/lib/libc/net/inet_net_ntop.c +++ b/lib/libc/net/inet_net_ntop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet_net_ntop.c,v 1.4 2004/09/15 19:01:28 deraadt Exp $ */ +/* $OpenBSD: inet_net_ntop.c,v 1.5 2005/03/25 13:24:12 otto Exp $ */ /* * Copyright (c) 1996 by Internet Software Consortium. @@ -21,7 +21,7 @@ #if 0 static const char rcsid[] = "$From: inet_net_ntop.c,v 8.2 1996/08/08 06:54:44 vixie Exp $"; #else -static const char rcsid[] = "$OpenBSD: inet_net_ntop.c,v 1.4 2004/09/15 19:01:28 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: inet_net_ntop.c,v 1.5 2005/03/25 13:24:12 otto Exp $"; #endif #endif @@ -48,12 +48,7 @@ static char *inet_net_ntop_ipv4(const u_char *, int, char *, size_t); * Paul Vixie (ISC), July 1996 */ char * -inet_net_ntop(af, src, bits, dst, size) - int af; - const void *src; - int bits; - char *dst; - size_t size; +inet_net_ntop(int af, const void *src, int bits, char *dst, size_t size) { switch (af) { case AF_INET: @@ -78,11 +73,7 @@ inet_net_ntop(af, src, bits, dst, size) * Paul Vixie (ISC), July 1996 */ static char * -inet_net_ntop_ipv4(src, bits, dst, size) - const u_char *src; - int bits; - char *dst; - size_t size; +inet_net_ntop_ipv4(const u_char *src, int bits, char *dst, size_t size) { char *odst = dst; u_int m; diff --git a/lib/libc/net/inet_net_pton.c b/lib/libc/net/inet_net_pton.c index 3c72efac6b7..e544ca7e28c 100644 --- a/lib/libc/net/inet_net_pton.c +++ b/lib/libc/net/inet_net_pton.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet_net_pton.c,v 1.3 2003/04/25 19:40:25 henning Exp $ */ +/* $OpenBSD: inet_net_pton.c,v 1.4 2005/03/25 13:24:12 otto Exp $ */ /* * Copyright (c) 1996 by Internet Software Consortium. @@ -21,7 +21,7 @@ #if 0 static const char rcsid[] = "$From: inet_net_pton.c,v 8.3 1996/11/11 06:36:52 vixie Exp $"; #else -static const char rcsid[] = "$OpenBSD: inet_net_pton.c,v 1.3 2003/04/25 19:40:25 henning Exp $"; +static const char rcsid[] = "$OpenBSD: inet_net_pton.c,v 1.4 2005/03/25 13:24:12 otto Exp $"; #endif #endif @@ -53,11 +53,7 @@ static int inet_net_pton_ipv4(const char *, u_char *, size_t); * Paul Vixie (ISC), June 1996 */ int -inet_net_pton(af, src, dst, size) - int af; - const char *src; - void *dst; - size_t size; +inet_net_pton(int af, const char *src, void *dst, size_t size) { switch (af) { case AF_INET: @@ -85,10 +81,7 @@ inet_net_pton(af, src, dst, size) * Paul Vixie (ISC), June 1996 */ static int -inet_net_pton_ipv4(src, dst, size) - const char *src; - u_char *dst; - size_t size; +inet_net_pton_ipv4(const char *src, u_char *dst, size_t size) { static const char xdigits[] = "0123456789abcdef", diff --git a/lib/libc/net/inet_neta.c b/lib/libc/net/inet_neta.c index c13e084d2d3..c9bb3c04642 100644 --- a/lib/libc/net/inet_neta.c +++ b/lib/libc/net/inet_neta.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet_neta.c,v 1.5 2005/03/02 12:27:26 millert Exp $ */ +/* $OpenBSD: inet_neta.c,v 1.6 2005/03/25 13:24:12 otto Exp $ */ /* * Copyright (c) 1996 by Internet Software Consortium. @@ -18,7 +18,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$OpenBSD: inet_neta.c,v 1.5 2005/03/02 12:27:26 millert Exp $"; +static const char rcsid[] = "$OpenBSD: inet_neta.c,v 1.6 2005/03/25 13:24:12 otto Exp $"; #endif #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 * Paul Vixie (ISC), July 1996 */ char * -inet_neta(src, dst, size) - in_addr_t src; - char *dst; - size_t size; +inet_neta(in_addr_t src, char *dst, size_t size) { char *odst = dst; char *ep; diff --git a/lib/libc/net/inet_netof.c b/lib/libc/net/inet_netof.c index 58be2d05cd9..83f346c5f55 100644 --- a/lib/libc/net/inet_netof.c +++ b/lib/libc/net/inet_netof.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: inet_netof.c,v 1.4 2003/06/02 20:18:35 millert Exp $"; +static char rcsid[] = "$OpenBSD: inet_netof.c,v 1.5 2005/03/25 13:24:12 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #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 * address; handles class a/b/c network #'s. */ in_addr_t -inet_netof(in) - struct in_addr in; +inet_netof(struct in_addr in) { - register in_addr_t i = ntohl(in.s_addr); + in_addr_t i = ntohl(in.s_addr); if (IN_CLASSA(i)) return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT); diff --git a/lib/libc/net/inet_network.c b/lib/libc/net/inet_network.c index 5e36f780693..7a7956ec836 100644 --- a/lib/libc/net/inet_network.c +++ b/lib/libc/net/inet_network.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: inet_network.c,v 1.8 2003/06/02 20:18:35 millert Exp $"; +static char rcsid[] = "$OpenBSD: inet_network.c,v 1.9 2005/03/25 13:24:12 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #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 * network numbers. */ in_addr_t -inet_network(cp) - register const char *cp; +inet_network(const char *cp) { - register in_addr_t val, base, n; - register char c; + in_addr_t val, base, n; + char c; in_addr_t parts[4], *pp = parts; - register int i; + int i; again: val = 0; base = 10; diff --git a/lib/libc/net/inet_ntoa.c b/lib/libc/net/inet_ntoa.c index bd3fd98b095..0e7fe863f63 100644 --- a/lib/libc/net/inet_ntoa.c +++ b/lib/libc/net/inet_ntoa.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: inet_ntoa.c,v 1.4 2003/06/02 20:18:35 millert Exp $"; +static char rcsid[] = "$OpenBSD: inet_ntoa.c,v 1.5 2005/03/25 13:24:12 otto Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -41,11 +41,10 @@ static char rcsid[] = "$OpenBSD: inet_ntoa.c,v 1.4 2003/06/02 20:18:35 millert E #include <stdio.h> char * -inet_ntoa(in) - struct in_addr in; +inet_ntoa(struct in_addr in) { static char b[18]; - register char *p; + char *p; p = (char *)∈ #define UC(b) (((int)b)&0xff) diff --git a/lib/libc/net/inet_ntop.c b/lib/libc/net/inet_ntop.c index adce61c1d46..ec5c12983a8 100644 --- a/lib/libc/net/inet_ntop.c +++ b/lib/libc/net/inet_ntop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet_ntop.c,v 1.5 2002/08/23 16:27:31 itojun Exp $ */ +/* $OpenBSD: inet_ntop.c,v 1.6 2005/03/25 13:24:12 otto Exp $ */ /* Copyright (c) 1996 by Internet Software Consortium. * @@ -20,7 +20,7 @@ #if 0 static char rcsid[] = "$From: inet_ntop.c,v 8.7 1996/08/05 08:41:18 vixie Exp $"; #else -static char rcsid[] = "$OpenBSD: inet_ntop.c,v 1.5 2002/08/23 16:27:31 itojun Exp $"; +static char rcsid[] = "$OpenBSD: inet_ntop.c,v 1.6 2005/03/25 13:24:12 otto Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -51,11 +51,7 @@ static const char *inet_ntop6(const u_char *src, char *dst, size_t size); * Paul Vixie, 1996. */ const char * -inet_ntop(af, src, dst, size) - int af; - const void *src; - char *dst; - size_t size; +inet_ntop(int af, const void *src, char *dst, size_t size) { switch (af) { case AF_INET: @@ -81,10 +77,7 @@ inet_ntop(af, src, dst, size) * Paul Vixie, 1996. */ static const char * -inet_ntop4(src, dst, size) - const u_char *src; - char *dst; - size_t size; +inet_ntop4(const u_char *src, char *dst, size_t size) { static const char fmt[] = "%u.%u.%u.%u"; char tmp[sizeof "255.255.255.255"]; @@ -106,10 +99,7 @@ inet_ntop4(src, dst, size) * Paul Vixie, 1996. */ static const char * -inet_ntop6(src, dst, size) - const u_char *src; - char *dst; - size_t size; +inet_ntop6(const u_char *src, char *dst, size_t size) { /* * Note that int32_t and int16_t need only be "at least" large enough diff --git a/lib/libc/net/inet_pton.c b/lib/libc/net/inet_pton.c index b04ef05c317..ec158d45994 100644 --- a/lib/libc/net/inet_pton.c +++ b/lib/libc/net/inet_pton.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet_pton.c,v 1.4 2002/02/16 21:27:23 millert Exp $ */ +/* $OpenBSD: inet_pton.c,v 1.5 2005/03/25 13:24:12 otto Exp $ */ /* Copyright (c) 1996 by Internet Software Consortium. * @@ -20,7 +20,7 @@ #if 0 static char rcsid[] = "$From: inet_pton.c,v 8.7 1996/08/05 08:31:35 vixie Exp $"; #else -static char rcsid[] = "$OpenBSD: inet_pton.c,v 1.4 2002/02/16 21:27:23 millert Exp $"; +static char rcsid[] = "$OpenBSD: inet_pton.c,v 1.5 2005/03/25 13:24:12 otto Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -53,10 +53,7 @@ static int inet_pton6(const char *src, u_char *dst); * Paul Vixie, 1996. */ int -inet_pton(af, src, dst) - int af; - const char *src; - void *dst; +inet_pton(int af, const char *src, void *dst) { switch (af) { case AF_INET: @@ -81,9 +78,7 @@ inet_pton(af, src, dst) * Paul Vixie, 1996. */ static int -inet_pton4(src, dst) - const char *src; - u_char *dst; +inet_pton4(const char *src, u_char *dst) { static const char digits[] = "0123456789"; int saw_digit, octets, ch; @@ -135,9 +130,7 @@ inet_pton4(src, dst) * Paul Vixie, 1996. */ static int -inet_pton6(src, dst) - const char *src; - u_char *dst; +inet_pton6(const char *src, u_char *dst) { static const char xdigits_l[] = "0123456789abcdef", xdigits_u[] = "0123456789ABCDEF"; diff --git a/lib/libc/net/ip6opt.c b/lib/libc/net/ip6opt.c index cbd49f0c22c..565c0ed3694 100644 --- a/lib/libc/net/ip6opt.c +++ b/lib/libc/net/ip6opt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6opt.c,v 1.1 1999/12/11 08:09:11 itojun Exp $ */ +/* $OpenBSD: ip6opt.c,v 1.2 2005/03/25 13:24:12 otto Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -52,8 +52,7 @@ static void inet6_insert_padopt(u_char *p, int len); * byte, the length byte, and the option data. */ int -inet6_option_space(nbytes) - int nbytes; +inet6_option_space(int nbytes) { nbytes += 2; /* we need space for nxt-hdr and length fields */ return(CMSG_SPACE((nbytes + 7) & ~7)); @@ -65,12 +64,9 @@ inet6_option_space(nbytes) * success or -1 on an error. */ int -inet6_option_init(bp, cmsgp, type) - void *bp; - struct cmsghdr **cmsgp; - int type; +inet6_option_init(void *bp, struct cmsghdr **cmsgp, int type) { - register struct cmsghdr *ch = (struct cmsghdr *)bp; + struct cmsghdr *ch = (struct cmsghdr *)bp; /* argument validation */ if (type != IPV6_HOPOPTS && type != IPV6_DSTOPTS) @@ -95,14 +91,11 @@ inet6_option_init(bp, cmsgp, type) * earlier. It must have a value between 0 and 7, inclusive. */ int -inet6_option_append(cmsg, typep, multx, plusy) - struct cmsghdr *cmsg; - const u_int8_t *typep; - int multx; - int plusy; +inet6_option_append(struct cmsghdr *cmsg, const u_int8_t *typep, int multx, + int plusy) { int padlen, optlen, off; - register u_char *bp = (u_char *)cmsg + cmsg->cmsg_len; + u_char *bp = (u_char *)cmsg + cmsg->cmsg_len; struct ip6_ext *eh = (struct ip6_ext *)CMSG_DATA(cmsg); /* argument validation */ @@ -170,14 +163,10 @@ inet6_option_append(cmsg, typep, multx, plusy) * */ u_int8_t * -inet6_option_alloc(cmsg, datalen, multx, plusy) - struct cmsghdr *cmsg; - int datalen; - int multx; - int plusy; +inet6_option_alloc(struct cmsghdr *cmsg, int datalen, int multx, int plusy) { int padlen, off; - register u_int8_t *bp = (u_char *)cmsg + cmsg->cmsg_len; + u_int8_t *bp = (u_char *)cmsg + cmsg->cmsg_len; u_int8_t *retval; struct ip6_ext *eh = (struct ip6_ext *)CMSG_DATA(cmsg); @@ -237,9 +226,7 @@ inet6_option_alloc(cmsg, datalen, multx, plusy) * (RFC 2292, 6.3.5) */ int -inet6_option_next(cmsg, tptrp) - const struct cmsghdr *cmsg; - u_int8_t **tptrp; +inet6_option_next(const struct cmsghdr *cmsg, u_int8_t **tptrp) { struct ip6_ext *ip6e; int hdrlen, optlen; @@ -295,10 +282,7 @@ inet6_option_next(cmsg, tptrp) * it's a typo. The variable should be type of u_int8_t **. */ int -inet6_option_find(cmsg, tptrp, type) - const struct cmsghdr *cmsg; - u_int8_t **tptrp; - int type; +inet6_option_find(const struct cmsghdr *cmsg, u_int8_t **tptrp, int type) { struct ip6_ext *ip6e; int hdrlen, optlen; @@ -351,8 +335,7 @@ inet6_option_find(cmsg, tptrp, type) * calculated length and the limitation of the buffer. */ static int -ip6optlen(opt, lim) - u_int8_t *opt, *lim; +ip6optlen(u_int8_t *opt, u_int8_t *lim) { int optlen; diff --git a/lib/libc/net/ipx_addr.c b/lib/libc/net/ipx_addr.c index 371ac7c917f..c7f83061285 100644 --- a/lib/libc/net/ipx_addr.c +++ b/lib/libc/net/ipx_addr.c @@ -33,7 +33,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: ipx_addr.c,v 1.6 2003/06/02 20:18:35 millert Exp $"; +static char rcsid[] = "$OpenBSD: ipx_addr.c,v 1.7 2005/03/25 13:24:12 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #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 static struct ipx_addr addr, zero_addr; -static void Field(), cvtbase(); +static void Field(char *, u_char *, int); +static void cvtbase(long, int, int *, int, unsigned char *, int); struct ipx_addr -ipx_addr(name) - const char *name; +ipx_addr(const char *name) { char separator; char *hostname, *socketname, *cp; @@ -92,12 +92,9 @@ ipx_addr(name) } static void -Field(buf, out, len) - char *buf; - u_char *out; - int len; +Field(char *buf, u_char *out, int len) { - register char *bp = buf; + char *bp = buf; int i, ibase, base16 = 0, base10 = 0, clen = 0; int hb[6], *hp; char *fmt; @@ -196,13 +193,8 @@ Field(buf, out, len) } static void -cvtbase(oldbase,newbase,input,inlen,result,reslen) - long oldbase; - int newbase; - int input[]; - int inlen; - unsigned char result[]; - int reslen; +cvtbase(long oldbase, int newbase, int *input, int inlen, + unsigned char *result, int reslen) { int d, e; long sum; diff --git a/lib/libc/net/linkaddr.c b/lib/libc/net/linkaddr.c index ee45ff767db..fcb0164ca49 100644 --- a/lib/libc/net/linkaddr.c +++ b/lib/libc/net/linkaddr.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: linkaddr.c,v 1.3 2003/06/02 20:18:35 millert Exp $"; +static char rcsid[] = "$OpenBSD: linkaddr.c,v 1.4 2005/03/25 13:24:12 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #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 #define LETTER (4*3) void -link_addr(addr, sdl) - register const char *addr; - register struct sockaddr_dl *sdl; +link_addr(const char *addr, struct sockaddr_dl *sdl) { - register char *cp = sdl->sdl_data; + char *cp = sdl->sdl_data; char *cplim = sdl->sdl_len + (char *)sdl; - register int byte = 0, state = NAMING, new; + int byte = 0, state = NAMING, new; bzero((char *)&sdl->sdl_family, sdl->sdl_len - 1); sdl->sdl_family = AF_LINK; @@ -119,13 +117,12 @@ link_addr(addr, sdl) static char hexlist[] = "0123456789abcdef"; char * -link_ntoa(sdl) - register const struct sockaddr_dl *sdl; +link_ntoa(const struct sockaddr_dl *sdl) { static char obuf[64]; - register char *out = obuf; - register int i; - register u_char *in = (u_char *)LLADDR(sdl); + char *out = obuf; + int i; + u_char *in = (u_char *)LLADDR(sdl); u_char *inlim = in + sdl->sdl_alen; int firsttime = 1; diff --git a/lib/libc/net/net_addrcmp.c b/lib/libc/net/net_addrcmp.c index b5732ec99af..8f8f694f4c2 100644 --- a/lib/libc/net/net_addrcmp.c +++ b/lib/libc/net/net_addrcmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: net_addrcmp.c,v 1.8 2004/10/01 04:08:45 jsg Exp $ */ +/* $OpenBSD: net_addrcmp.c,v 1.9 2005/03/25 13:24:12 otto Exp $ */ /* * Copyright (c) 1999 Theo de Raadt @@ -33,9 +33,7 @@ #include <string.h> int -net_addrcmp(sa1, sa2) - struct sockaddr *sa1; - struct sockaddr *sa2; +net_addrcmp(struct sockaddr *sa1, struct sockaddr *sa2) { if (sa1->sa_len != sa2->sa_len) diff --git a/lib/libc/net/ns_addr.c b/lib/libc/net/ns_addr.c index 0f8feda55ca..03b14909c51 100644 --- a/lib/libc/net/ns_addr.c +++ b/lib/libc/net/ns_addr.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: ns_addr.c,v 1.8 2003/06/02 20:18:35 millert Exp $"; +static char rcsid[] = "$OpenBSD: ns_addr.c,v 1.9 2005/03/25 13:24:12 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -45,8 +45,7 @@ static void Field(char *, u_int8_t *, int); static void cvtbase(long, int, int[], int, u_int8_t[], int); struct ns_addr -ns_addr(name) - const char *name; +ns_addr(const char *name) { char separator; char *hostname, *socketname, *cp; @@ -91,12 +90,9 @@ ns_addr(name) } static void -Field(buf, out, len) - char *buf; - u_char *out; - int len; +Field(char *buf, u_char *out, int len) { - register char *bp = buf; + char *bp = buf; int i, ibase, base16 = 0, base10 = 0, clen = 0; int hb[6], *hp; char *fmt; @@ -195,13 +191,8 @@ Field(buf, out, len) } static void -cvtbase(oldbase,newbase,input,inlen,result,reslen) - long oldbase; - int newbase; - int input[]; - int inlen; - unsigned char result[]; - int reslen; +cvtbase(long int oldbase, int newbase, int *input, int inlen, + unsigned char *result, int reslen) { int d, e; long sum; diff --git a/lib/libc/net/nsap_addr.c b/lib/libc/net/nsap_addr.c index 22a5f8d66ec..58c0d5e493b 100644 --- a/lib/libc/net/nsap_addr.c +++ b/lib/libc/net/nsap_addr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nsap_addr.c,v 1.4 1997/07/09 01:08:45 millert Exp $ */ +/* $OpenBSD: nsap_addr.c,v 1.5 2005/03/25 13:24:12 otto Exp $ */ /* * Copyright (c) 1996 by Internet Software Consortium. @@ -21,7 +21,7 @@ #if 0 static char rcsid[] = "$From: nsap_addr.c,v 8.3 1996/08/05 08:31:35 vixie Exp $"; #else -static char rcsid[] = "$OpenBSD: nsap_addr.c,v 1.4 1997/07/09 01:08:45 millert Exp $"; +static char rcsid[] = "$OpenBSD: nsap_addr.c,v 1.5 2005/03/25 13:24:12 otto Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -34,19 +34,15 @@ static char rcsid[] = "$OpenBSD: nsap_addr.c,v 1.4 1997/07/09 01:08:45 millert E #include <resolv.h> static char -xtob(c) - register int c; +xtob(int c) { return (c - (((c >= '0') && (c <= '9')) ? '0' : '7')); } u_int -inet_nsap_addr(ascii, binary, maxlen) - const char *ascii; - u_char *binary; - int maxlen; +inet_nsap_addr(const char *ascii, u_char *binary, int maxlen) { - register u_char c, nib; + u_char c, nib; u_int len = 0; while ((c = *ascii++) != '\0' && len < maxlen) { @@ -76,12 +72,9 @@ inet_nsap_addr(ascii, binary, maxlen) } char * -inet_nsap_ntoa(binlen, binary, ascii) - int binlen; - register const u_char *binary; - register char *ascii; +inet_nsap_ntoa(int binlen, const u_char *binary, char *ascii) { - register int nib; + int nib; int i; static char tmpbuf[255*3]; char *start; diff --git a/lib/libc/net/ntohl.c b/lib/libc/net/ntohl.c index 7d3e227e607..c8b2ca2bb5a 100644 --- a/lib/libc/net/ntohl.c +++ b/lib/libc/net/ntohl.c @@ -4,7 +4,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: ntohl.c,v 1.4 1996/12/12 03:19:56 tholo Exp $"; +static char *rcsid = "$OpenBSD: ntohl.c,v 1.5 2005/03/25 13:24:12 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #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 $"; #undef ntohl u_int32_t -ntohl(x) - u_int32_t x; +ntohl(u_int32_t x) { #if BYTE_ORDER == LITTLE_ENDIAN u_char *s = (u_char *)&x; diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c index 96d62567607..bfe8c3ae564 100644 --- a/lib/libc/net/rcmd.c +++ b/lib/libc/net/rcmd.c @@ -29,7 +29,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: rcmd.c,v 1.51 2005/03/08 18:34:42 deraadt Exp $"; +static char *rcsid = "$OpenBSD: rcmd.c,v 1.52 2005/03/25 13:24:12 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -59,22 +59,15 @@ static int __icheckhost(struct sockaddr *, socklen_t, const char *); static char *__gethostloop(struct sockaddr *, socklen_t); int -rcmd(ahost, rport, locuser, remuser, cmd, fd2p) - char **ahost; - in_port_t rport; - const char *locuser, *remuser, *cmd; - int *fd2p; +rcmd(char **ahost, int rport, const char *locuser, const char *remuser, + const char *cmd, int *fd2p) { return rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, AF_INET); } int -rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af) - char **ahost; - in_port_t rport; - const char *locuser, *remuser, *cmd; - int *fd2p; - int af; +rcmd_af(char **ahost, int porta, const char *locuser, const char *remuser, + const char *cmd, int *fd2p, int af) { static char hbuf[MAXHOSTNAMELEN]; char pbuf[NI_MAXSERV]; @@ -87,6 +80,7 @@ rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af) int s, lport, timo; char c, *p; int refused; + in_port_t rport = porta; /* call rcmdsh() with specified remote shell if appropriate. */ if (!issetugid() && (p = getenv("RSH")) && *p) { @@ -322,9 +316,7 @@ int __check_rhosts_file = 1; char *__rcmd_errstr; int -ruserok(rhost, superuser, ruser, luser) - const char *rhost, *ruser, *luser; - int superuser; +ruserok(const char *rhost, int superuser, const char *ruser, const char *luser) { struct addrinfo hints, *res, *r; int error; @@ -357,10 +349,7 @@ ruserok(rhost, superuser, ruser, luser) * Returns 0 if ok, -1 if not ok. */ int -iruserok(raddr, superuser, ruser, luser) - u_int32_t raddr; - int superuser; - const char *ruser, *luser; +iruserok(u_int32_t raddr, int superuser, const char *ruser, const char *luser) { struct sockaddr_in sin; @@ -373,14 +362,11 @@ iruserok(raddr, superuser, ruser, luser) } int -iruserok_sa(raddr, rlen, superuser, ruser, luser) - const void *raddr; - int rlen; - int superuser; - const char *ruser, *luser; +iruserok_sa(const void *raddr, int rlen, int superuser, const char *ruser, + const char *luser) { struct sockaddr *sa; - register char *cp; + char *cp; struct stat sbuf; struct passwd *pwd; FILE *hostf; @@ -450,10 +436,8 @@ again: * Returns 0 if ok, -1 if not ok. */ int -__ivaliduser(hostf, raddrl, luser, ruser) - FILE *hostf; - in_addr_t raddrl; - const char *luser, *ruser; +__ivaliduser(FILE *hostf, in_addr_t raddrl, const char *luser, + const char *ruser) { struct sockaddr_in sin; @@ -466,13 +450,10 @@ __ivaliduser(hostf, raddrl, luser, ruser) } int -__ivaliduser_sa(hostf, raddr, salen, luser, ruser) - FILE *hostf; - struct sockaddr *raddr; - socklen_t salen; - const char *luser, *ruser; +__ivaliduser_sa(FILE *hostf, struct sockaddr *raddr, socklen_t salen, + const char *luser, const char *ruser) { - register char *user, *p; + char *user, *p; char *buf; const char *auser, *ahost; int hostok, userok; @@ -613,10 +594,7 @@ bail: * semblance of an A->PTR->A loop, allow a simple #.#.#.# match to work. */ static int -__icheckhost(raddr, salen, lhost) - struct sockaddr *raddr; - socklen_t salen; - const char *lhost; +__icheckhost(struct sockaddr *raddr, socklen_t salen, const char *lhost) { struct addrinfo hints, *res, *r; char h1[NI_MAXHOST], h2[NI_MAXHOST]; @@ -662,9 +640,7 @@ __icheckhost(raddr, salen, lhost) * be found, pack the result of inet_ntoa() into the string. */ static char * -__gethostloop(raddr, salen) - struct sockaddr *raddr; - socklen_t salen; +__gethostloop(struct sockaddr *raddr, socklen_t salen) { static char remotehost[NI_MAXHOST]; char h1[NI_MAXHOST], h2[NI_MAXHOST]; diff --git a/lib/libc/net/rcmdsh.c b/lib/libc/net/rcmdsh.c index 3ec97e4763d..28f0ca88a62 100644 --- a/lib/libc/net/rcmdsh.c +++ b/lib/libc/net/rcmdsh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcmdsh.c,v 1.9 2004/04/01 04:14:29 marc Exp $ */ +/* $OpenBSD: rcmdsh.c,v 1.10 2005/03/25 13:24:12 otto Exp $ */ /* * Copyright (c) 2001, MagniComp @@ -34,7 +34,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.9 2004/04/01 04:14:29 marc Exp $"; +static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.10 2005/03/25 13:24:12 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #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 $"; */ /* ARGSUSED */ int -rcmdsh(ahost, rport, locuser, remuser, cmd, rshprog) - char **ahost; - int rport; - const char *locuser, *remuser, *cmd; - char *rshprog; +rcmdsh(char **ahost, int rport, const char *locuser, const char *remuser, + const char *cmd, char *rshprog) { struct hostent *hp; int sp[2]; diff --git a/lib/libc/net/recv.c b/lib/libc/net/recv.c index 09474653772..981b5e7a6ae 100644 --- a/lib/libc/net/recv.c +++ b/lib/libc/net/recv.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: recv.c,v 1.3 2003/06/02 20:18:35 millert Exp $"; +static char rcsid[] = "$OpenBSD: recv.c,v 1.4 2005/03/25 13:24:12 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #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 $" #include <stddef.h> ssize_t -recv(s, buf, len, flags) - int s, flags; - size_t len; - void *buf; +recv(int s, void *buf, size_t len, int flags) { return (recvfrom(s, buf, len, flags, NULL, 0)); } diff --git a/lib/libc/net/res_comp.c b/lib/libc/net/res_comp.c index c10eb52931f..62c04d8518f 100644 --- a/lib/libc/net/res_comp.c +++ b/lib/libc/net/res_comp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: res_comp.c,v 1.11 2003/06/02 20:18:36 millert Exp $ */ +/* $OpenBSD: res_comp.c,v 1.12 2005/03/25 13:24:12 otto Exp $ */ /* * ++Copyright++ 1985, 1993 @@ -56,7 +56,7 @@ static char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93"; static char rcsid[] = "$From: res_comp.c,v 8.11 1996/12/02 09:17:22 vixie Exp $"; #else -static char rcsid[] = "$OpenBSD: res_comp.c,v 1.11 2003/06/02 20:18:36 millert Exp $"; +static char rcsid[] = "$OpenBSD: res_comp.c,v 1.12 2005/03/25 13:24:12 otto Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -82,14 +82,12 @@ static int dn_find(u_char *, u_char *, u_char **, u_char **); * Return size of compressed name or -1 if there was an error. */ int -dn_expand(msg, eomorig, comp_dn, exp_dn, length) - const u_char *msg, *eomorig, *comp_dn; - char *exp_dn; - int length; +dn_expand(const u_char *msg, const u_char *eomorig, const u_char *comp_dn, + char *exp_dn, int length) { - register const u_char *cp; - register char *dn; - register int n, c; + const u_char *cp; + char *dn; + int n, c; char *eom; int len = -1, checked = 0; @@ -166,13 +164,11 @@ dn_expand(msg, eomorig, comp_dn, exp_dn, length) * is NULL, we don't update the list. */ int -dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr) - const char *exp_dn; - u_char *comp_dn, **dnptrs, **lastdnptr; - int length; +dn_comp(const char *exp_dn, u_char *comp_dn, int length, u_char **dnptrs, + u_char **lastdnptr) { - register u_char *cp, *dn; - register int c, l; + u_char *cp, *dn; + int c, l; u_char **cpp, **lpp, *sp, *eob; u_char *msg; @@ -246,11 +242,10 @@ dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr) * Skip over a compressed domain name. Return the size or -1. */ int -__dn_skipname(comp_dn, eom) - const u_char *comp_dn, *eom; +__dn_skipname(const u_char *comp_dn, const u_char *eom) { - register const u_char *cp; - register int n; + const u_char *cp; + int n; cp = comp_dn; while (cp < eom && (n = *cp++)) { @@ -275,8 +270,7 @@ __dn_skipname(comp_dn, eom) } static int -mklower(ch) - register int ch; +mklower(int ch) { if (isascii(ch) && isupper(ch)) return (tolower(ch)); @@ -290,12 +284,10 @@ mklower(ch) * not the pointer to the start of the message. */ static int -dn_find(exp_dn, msg, dnptrs, lastdnptr) - u_char *exp_dn, *msg; - u_char **dnptrs, **lastdnptr; +dn_find(u_char *exp_dn, u_char *msg, u_char **dnptrs, u_char **lastdnptr) { - register u_char *dn, *cp, **cpp; - register int n; + u_char *dn, *cp, **cpp; + int n; u_char *sp; for (cpp = dnptrs; cpp < lastdnptr; cpp++) { @@ -360,8 +352,7 @@ dn_find(exp_dn, msg, dnptrs, lastdnptr) #define domainchar(c) ((c) > 0x20 && (c) < 0x7f) int -res_hnok(dn) - const char *dn; +res_hnok(const char *dn) { int pch = PERIOD, ch = *dn++; @@ -390,8 +381,7 @@ res_hnok(dn) * but must otherwise be as a host name. */ int -res_ownok(dn) - const char *dn; +res_ownok(const char *dn) { if (asterchar(dn[0])) { if (periodchar(dn[1])) @@ -407,8 +397,7 @@ res_ownok(dn) * label, but the rest of the name has to look like a host name. */ int -res_mailok(dn) - const char *dn; +res_mailok(const char *dn) { int ch, escaped = 0; @@ -437,8 +426,7 @@ res_mailok(dn) * recommendations. */ int -res_dnok(dn) - const char *dn; +res_dnok(const char *dn) { int ch; @@ -453,10 +441,9 @@ res_dnok(dn) */ u_int16_t -_getshort(msgp) - register const u_char *msgp; +_getshort(const u_char *msgp) { - register u_int16_t u; + u_int16_t u; GETSHORT(u, msgp); return (u); @@ -468,32 +455,29 @@ _getshort(msgp) */ u_int16_t res_getshort(msgp) - register const u_char *msgp; + const u_char *msgp; { return (_getshort(msgp)); } #endif u_int32_t -_getlong(msgp) - register const u_char *msgp; +_getlong(const u_char *msgp) { - register u_int32_t u; + u_int32_t u; GETLONG(u, msgp); return (u); } void -__putshort(register u_int16_t s, register u_char *msgp) +__putshort(u_int16_t s, u_char *msgp) { PUTSHORT(s, msgp); } void -__putlong(l, msgp) - register u_int32_t l; - register u_char *msgp; +__putlong(u_int32_t l, u_char *msgp) { PUTLONG(l, msgp); } diff --git a/lib/libc/net/res_debug.c b/lib/libc/net/res_debug.c index e0f2a894186..02f9e4a1ea1 100644 --- a/lib/libc/net/res_debug.c +++ b/lib/libc/net/res_debug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: res_debug.c,v 1.18 2005/03/06 16:17:23 moritz Exp $ */ +/* $OpenBSD: res_debug.c,v 1.19 2005/03/25 13:24:12 otto Exp $ */ /* * ++Copyright++ 1985, 1990, 1993 @@ -78,7 +78,7 @@ static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93"; static char rcsid[] = "$From: res_debug.c,v 8.19 1996/11/26 10:11:23 vixie Exp $"; #else -static char rcsid[] = "$OpenBSD: res_debug.c,v 1.18 2005/03/06 16:17:23 moritz Exp $"; +static char rcsid[] = "$OpenBSD: res_debug.c,v 1.19 2005/03/25 13:24:12 otto Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -107,8 +107,7 @@ static const char *loc_ntoal(const u_char *binary, char *ascii, int ascii_len); /* XXX: we should use getservbyport() instead. */ static const char * -dewks(wks) - int wks; +dewks(int wks) { static char nbuf[20]; @@ -167,8 +166,7 @@ dewks(wks) /* XXX: we should use getprotobynumber() instead. */ static const char * -deproto(protonum) - int protonum; +deproto(int protonum) { static char nbuf[20]; @@ -192,11 +190,8 @@ deproto(protonum) } static const u_char * -do_rrset(msg, len, cp, cnt, pflag, file, hs) - int cnt, pflag, len; - const u_char *cp, *msg; - const char *hs; - FILE *file; +do_rrset(const u_char *msg, int len, const u_char *cp, int cnt, int pflag, + FILE *file, const char *hs) { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); int n; @@ -234,8 +229,7 @@ do_rrset(msg, len, cp, cnt, pflag, file, hs) } void -__p_query(msg) - const u_char *msg; +__p_query(const u_char *msg) { __fp_query(msg, stdout); } @@ -245,11 +239,9 @@ __p_query(msg) * This is intended to be primarily a debugging routine. */ void -__fp_resstat(statp, file) - struct __res_state *statp; - FILE *file; +__fp_resstat(struct __res_state *statp, FILE *file) { - register u_long mask; + u_long mask; fprintf(file, ";; res options:"); if (!statp) @@ -265,15 +257,12 @@ __fp_resstat(statp, file) * This is intended to be primarily a debugging routine. */ void -__fp_nquery(msg, len, file) - const u_char *msg; - int len; - FILE *file; +__fp_nquery(const u_char *msg, int len, FILE *file) { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); - register const u_char *cp, *endMark; - register const HEADER *hp; - register int n; + const u_char *cp, *endMark; + const HEADER *hp; + int n; if ((_resp->options & RES_INIT) == 0 && res_init() == -1) return; @@ -394,18 +383,13 @@ __fp_nquery(msg, len, file) } void -__fp_query(msg, file) - const u_char *msg; - FILE *file; +__fp_query(const u_char *msg, FILE *file) { fp_nquery(msg, PACKETSZ, file); } const u_char * -__p_cdnname(cp, msg, len, file) - const u_char *cp, *msg; - int len; - FILE *file; +__p_cdnname(const u_char *cp, const u_char *msg, int len, FILE *file) { char name[MAXDNAME]; int n; @@ -420,9 +404,7 @@ __p_cdnname(cp, msg, len, file) } const u_char * -__p_cdname(cp, msg, file) - const u_char *cp, *msg; - FILE *file; +__p_cdname(const u_char *cp, const u_char *msg, FILE *file) { return (p_cdnname(cp, msg, PACKETSZ, file)); } @@ -432,11 +414,7 @@ __p_cdname(cp, msg, file) length supplied). */ const u_char * -__p_fqnname(cp, msg, msglen, name, namelen) - const u_char *cp, *msg; - int msglen; - char *name; - int namelen; +__p_fqnname(const u_char *cp, const u_char *msg, int msglen, char *name, int namelen) { int n, newlen; @@ -456,9 +434,7 @@ __p_fqnname(cp, msg, msglen, name, namelen) */ const u_char * -__p_fqname(cp, msg, file) - const u_char *cp, *msg; - FILE *file; +__p_fqname(const u_char *cp, const u_char *msg, FILE *file) { char name[MAXDNAME]; const u_char *n; @@ -474,9 +450,7 @@ __p_fqname(cp, msg, file) * Print resource record fields in human readable form. */ const u_char * -__p_rr(cp, msg, file) - const u_char *cp, *msg; - FILE *file; +__p_rr(const u_char *cp, const u_char *msg, FILE *file) { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); int type, class, dlen, n, c; @@ -932,10 +906,7 @@ const struct res_sym __p_type_syms[] = { }; int -__sym_ston(syms, name, success) - const struct res_sym *syms; - char *name; - int *success; +__sym_ston(const struct res_sym *syms, char *name, int *success) { for (; syms->name != 0; syms++) { if (strcasecmp (name, syms->name) == 0) { @@ -950,10 +921,7 @@ __sym_ston(syms, name, success) } const char * -__sym_ntos(syms, number, success) - const struct res_sym *syms; - int number; - int *success; +__sym_ntos(const struct res_sym *syms, int number, int *success) { static char unname[20]; @@ -973,10 +941,7 @@ __sym_ntos(syms, number, success) const char * -__sym_ntop(syms, number, success) - const struct res_sym *syms; - int number; - int *success; +__sym_ntop(const struct res_sym *syms, int number, int *success) { static char unname[20]; @@ -997,8 +962,7 @@ __sym_ntop(syms, number, success) * Return a string for the type */ const char * -__p_type(type) - int type; +__p_type(int type) { return (__sym_ntos (__p_type_syms, type, (int *)0)); } @@ -1007,8 +971,7 @@ __p_type(type) * Return a mnemonic for class */ const char * -__p_class(class) - int class; +__p_class(int class) { return (__sym_ntos (__p_class_syms, class, (int *)0)); } @@ -1017,8 +980,7 @@ __p_class(class) * Return a mnemonic for an option */ const char * -__p_option(option) - u_long option; +__p_option(u_long option) { static char nbuf[40]; @@ -1047,13 +1009,12 @@ __p_option(option) * Return a mnemonic for a time to live */ const char * -p_time(value) - u_int32_t value; +p_time(u_int32_t value) { static char nbuf[40]; char *ebuf; int secs, mins, hours, days; - register char *p; + char *p; int tmp; if (value == 0) { @@ -1129,8 +1090,7 @@ static unsigned int poweroften[10] = {1, 10, 100, 1000, 10000, 100000, /* takes an XeY precision/size value, returns a string representation. */ static const char * -precsize_ntoa(prec) - u_int8_t prec; +precsize_ntoa(u_int8_t prec) { static char retbuf[sizeof "90000000.00"]; unsigned long val; @@ -1147,14 +1107,13 @@ precsize_ntoa(prec) /* converts ascii size/precision X * 10**Y(cm) to 0xXY. moves pointer. */ static u_int8_t -precsize_aton(strptr) - char **strptr; +precsize_aton(char **strptr) { unsigned int mval = 0, cmval = 0; u_int8_t retval = 0; - register char *cp; - register int exponent; - register int mantissa; + char *cp; + int exponent; + int mantissa; cp = *strptr; @@ -1189,11 +1148,9 @@ precsize_aton(strptr) /* converts ascii lat/lon to unsigned encoded 32-bit number. moves pointer. */ static u_int32_t -latlon2ul(latlonstrptr,which) - char **latlonstrptr; - int *which; +latlon2ul(char **latlonstrptr, int *which) { - register char *cp; + char *cp; u_int32_t retval; int deg = 0, min = 0, secs = 0, secsfrac = 0; @@ -1288,9 +1245,7 @@ latlon2ul(latlonstrptr,which) /* converts a zone file representation in a string to an RDATA on-the-wire * representation. */ int -loc_aton(ascii, binary) - const char *ascii; - u_char *binary; +loc_aton(const char *ascii, u_char *binary) { const char *maxcp; u_char *bcp; @@ -1399,22 +1354,17 @@ loc_aton(ascii, binary) } const char * -loc_ntoa(binary, ascii) - const u_char *binary; - char *ascii; +loc_ntoa(const u_char *binary, char *ascii) { return loc_ntoal(binary, ascii, 255); } /* takes an on-the-wire LOC RR and formats it in a human readable format. */ static const char * -loc_ntoal(binary, ascii, ascii_len) - const u_char *binary; - char *ascii; - int ascii_len; +loc_ntoal(const u_char *binary, char *ascii, int ascii_len) { static char *error = "?"; - register const u_char *cp = binary; + const u_char *cp = binary; int latdeg, latmin, latsec, latsecfrac; int longdeg, longmin, longsec, longsecfrac; @@ -1513,8 +1463,7 @@ loc_ntoal(binary, ascii, ascii_len) /* Return the number of DNS hierarchy levels in the name. */ int -__dn_count_labels(name) - char *name; +__dn_count_labels(char *name) { int i, len, count; @@ -1544,8 +1493,7 @@ __dn_count_labels(name) * SIG records are required to be printed like this, by the Secure DNS RFC. */ char * -__p_secstodate (secs) - unsigned long secs; +__p_secstodate (long unsigned int secs) { static char output[15]; /* YYYYMMDDHHMMSS and null */ time_t clock = secs; diff --git a/lib/libc/net/res_init.c b/lib/libc/net/res_init.c index 79ccada6eeb..f4a8d31cb1f 100644 --- a/lib/libc/net/res_init.c +++ b/lib/libc/net/res_init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: res_init.c,v 1.30 2004/06/07 21:11:23 marc Exp $ */ +/* $OpenBSD: res_init.c,v 1.31 2005/03/25 13:24:12 otto Exp $ */ /* * ++Copyright++ 1985, 1989, 1993 @@ -60,7 +60,7 @@ static char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93"; static char rcsid[] = "$From: res_init.c,v 8.7 1996/09/28 06:51:07 vixie Exp $"; #else -static char rcsid[] = "$OpenBSD: res_init.c,v 1.30 2004/06/07 21:11:23 marc Exp $"; +static char rcsid[] = "$OpenBSD: res_init.c,v 1.31 2005/03/25 13:24:12 otto Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -153,16 +153,16 @@ struct __res_state_ext _res_ext; * Return 0 if completes successfully, -1 on error */ int -res_init() +res_init(void) { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); #ifdef INET6 struct __res_state_ext *_res_extp = _THREAD_PRIVATE(_res_ext, _res_ext, &_res_ext); #endif - register FILE *fp; - register char *cp, **pp; - register int n; + FILE *fp; + char *cp, **pp; + int n; char buf[BUFSIZ]; int nserv = 0; /* number of nameserver records read from file */ int haveenv = 0; @@ -571,8 +571,7 @@ res_init() /* ARGSUSED */ static void -res_setoptions(options, source) - char *options, *source; +res_setoptions(char *options, char *source) { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); char *cp = options; @@ -632,10 +631,9 @@ res_setoptions(options, source) #ifdef RESOLVSORT /* XXX - should really support CIDR which means explicit masks always. */ static u_int32_t -net_mask(in) /* XXX - should really use system's version of this */ - struct in_addr in; +net_mask(struct in_addr in) /* XXX - should really use system's version of this */ { - register u_int32_t i = ntohl(in.s_addr); + u_int32_t i = ntohl(in.s_addr); if (IN_CLASSA(i)) return (htonl(IN_CLASSA_NET)); diff --git a/lib/libc/net/res_mkquery.c b/lib/libc/net/res_mkquery.c index 82aa2796c2f..28ae92056d8 100644 --- a/lib/libc/net/res_mkquery.c +++ b/lib/libc/net/res_mkquery.c @@ -1,4 +1,4 @@ -/* $OpenBSD: res_mkquery.c,v 1.14 2003/06/02 20:18:36 millert Exp $ */ +/* $OpenBSD: res_mkquery.c,v 1.15 2005/03/25 13:24:12 otto Exp $ */ /* * ++Copyright++ 1985, 1993 @@ -56,7 +56,7 @@ static char sccsid[] = "@(#)res_mkquery.c 8.1 (Berkeley) 6/4/93"; static char rcsid[] = "$From: res_mkquery.c,v 8.5 1996/08/27 08:33:28 vixie Exp $"; #else -static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.14 2003/06/02 20:18:36 millert Exp $"; +static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.15 2005/03/25 13:24:12 otto Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -78,20 +78,20 @@ static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.14 2003/06/02 20:18:36 miller */ /* ARGSUSED */ int -res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen) - int op; /* opcode of query */ - const char *dname; /* domain name */ - int class, type; /* class and type of query */ - const u_char *data; /* resource record data */ - int datalen; /* length of data */ - const u_char *newrr_in; /* new rr for modify or append */ - u_char *buf; /* buffer to put query */ - int buflen; /* size of buffer */ +res_mkquery(int op, + const char *dname, /* opcode of query */ + int class, /* domain name */ + int type, /* class and type of query */ + const u_char *data, /* resource record data */ + int datalen, /* length of data */ + const u_char *newrr_in, /* new rr for modify or append */ + u_char *buf, /* buffer to put query */ + int buflen) /* size of buffer */ { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); - register HEADER *hp; - register u_char *cp, *ep; - register int n; + HEADER *hp; + u_char *cp, *ep; + int n; u_char *dnptrs[20], **dpp, **lastdnptr; 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) /* attach OPT pseudo-RR, as documented in RFC2671 (EDNS0). */ int -res_opt(n0, buf, buflen, anslen) - int n0; - u_char *buf; /* buffer to put query */ - int buflen; /* size of buffer */ - int anslen; /* answer buffer length */ +res_opt(int n0, + u_char *buf, /* buffer to put query */ + int buflen, /* size of buffer */ + int anslen) /* answer buffer length */ { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); - register HEADER *hp; - register u_char *cp, *ep; + HEADER *hp; + u_char *cp, *ep; hp = (HEADER *) buf; cp = buf + n0; diff --git a/lib/libc/net/res_query.c b/lib/libc/net/res_query.c index 3cdb7a74772..677c411a6e4 100644 --- a/lib/libc/net/res_query.c +++ b/lib/libc/net/res_query.c @@ -1,4 +1,4 @@ -/* $OpenBSD: res_query.c,v 1.21 2003/06/02 20:18:36 millert Exp $ */ +/* $OpenBSD: res_query.c,v 1.22 2005/03/25 13:24:12 otto Exp $ */ /* * ++Copyright++ 1988, 1993 @@ -56,7 +56,7 @@ static char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93"; static char rcsid[] = "$From: res_query.c,v 8.9 1996/09/22 00:13:28 vixie Exp $"; #else -static char rcsid[] = "$OpenBSD: res_query.c,v 1.21 2003/06/02 20:18:36 millert Exp $"; +static char rcsid[] = "$OpenBSD: res_query.c,v 1.22 2005/03/25 13:24:12 otto Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -98,15 +98,15 @@ extern int res_opt(int, u_char *, int, int); * Caller must parse answer and determine whether it answers the question. */ int -res_query(name, class, type, answer, anslen) - const char *name; /* domain name */ - int class, type; /* class and type of query */ - u_char *answer; /* buffer to put answer */ - int anslen; /* size of answer buffer */ +res_query(const char *name, + int class, /* domain name */ + int type, /* class and type of query */ + u_char *answer, /* buffer to put answer */ + int anslen) /* size of answer buffer */ { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); u_char buf[MAXPACKET]; - register HEADER *hp = (HEADER *) answer; + HEADER *hp = (HEADER *) answer; int n; hp->rcode = NOERROR; /* default */ @@ -180,13 +180,13 @@ res_query(name, class, type, answer, anslen) * is detected. Error code, if any, is left in h_errno. */ int -res_search(name, class, type, answer, anslen) - const char *name; /* domain name */ - int class, type; /* class and type of query */ - u_char *answer; /* buffer to put answer */ - int anslen; /* size of answer */ +res_search(const char *name, + int class, /* domain name */ + int type, /* class and type of query */ + u_char *answer, /* buffer to put answer */ + int anslen) /* size of answer */ { - register const char *cp, * const *domain; + const char *cp, * const *domain; struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); HEADER *hp = (HEADER *) answer; u_int dots; @@ -320,11 +320,12 @@ res_search(name, class, type, answer, anslen) * removing a trailing dot from name if domain is NULL. */ int -res_querydomain(name, domain, class, type, answer, anslen) - const char *name, *domain; - int class, type; /* class and type of query */ - u_char *answer; /* buffer to put answer */ - int anslen; /* size of answer */ +res_querydomain(const char *name, + const char *domain, + int class, /* class and type of query */ + int type, + u_char *answer, /* buffer to put answer */ + int anslen) /* size of answer */ { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); char nbuf[MAXDNAME*2+1+1]; @@ -359,11 +360,10 @@ res_querydomain(name, domain, class, type, answer, anslen) } const char * -hostalias(name) - register const char *name; +hostalias(const char *name) { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); - register char *cp1, *cp2; + char *cp1, *cp2; FILE *fp; char *file; char buf[BUFSIZ]; diff --git a/lib/libc/net/res_random.c b/lib/libc/net/res_random.c index b52330b3ee0..4dc1d334629 100644 --- a/lib/libc/net/res_random.c +++ b/lib/libc/net/res_random.c @@ -1,4 +1,4 @@ -/* $OpenBSD: res_random.c,v 1.15 2003/12/12 06:57:12 itojun Exp $ */ +/* $OpenBSD: res_random.c,v 1.16 2005/03/25 13:24:12 otto Exp $ */ /* * 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) * application does not have to worry about it. */ static void -res_initid() +res_initid(void) { u_int16_t j, i; int noprime = 1; @@ -173,7 +173,7 @@ res_initid() } u_int -res_randomid() +res_randomid(void) { int i, n; diff --git a/lib/libc/net/res_send.c b/lib/libc/net/res_send.c index 51fa7771422..04eb268d902 100644 --- a/lib/libc/net/res_send.c +++ b/lib/libc/net/res_send.c @@ -1,4 +1,4 @@ -/* $OpenBSD: res_send.c,v 1.16 2004/11/17 01:42:26 itojun Exp $ */ +/* $OpenBSD: res_send.c,v 1.17 2005/03/25 13:24:12 otto Exp $ */ /* * ++Copyright++ 1985, 1989, 1993 @@ -60,7 +60,7 @@ static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93"; static char rcsid[] = "$From: res_send.c,v 8.12 1996/10/08 04:51:06 vixie Exp $"; #else -static char rcsid[] = "$OpenBSD: res_send.c,v 1.16 2004/11/17 01:42:26 itojun Exp $"; +static char rcsid[] = "$OpenBSD: res_send.c,v 1.17 2005/03/25 13:24:12 otto Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -128,11 +128,7 @@ static void Aerror(FILE *, char *, int, struct sockaddr *); static void Perror(FILE *, char *, int); static void - Aerror(file, string, error, address) - FILE *file; - char *string; - int error; - struct sockaddr *address; + Aerror(FILE *file, char *string, int error, struct sockaddr *address) { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); int save = errno; @@ -149,10 +145,7 @@ static void Perror(FILE *, char *, int); errno = save; } static void - Perror(file, string, error) - FILE *file; - char *string; - int error; + Perror(FILE *file, char *string, int error) { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); int save = errno; @@ -169,16 +162,14 @@ static res_send_qhook Qhook = NULL; static res_send_rhook Rhook = NULL; void -res_send_setqhook(hook) - res_send_qhook hook; +res_send_setqhook(res_send_qhook hook) { Qhook = hook; } void -res_send_setrhook(hook) - res_send_rhook hook; +res_send_setrhook(res_send_rhook hook) { Rhook = hook; @@ -191,8 +182,7 @@ static struct sockaddr * get_nsaddr(size_t); * pick appropriate nsaddr_list for use. see res_init() for initialization. */ static struct sockaddr * -get_nsaddr(n) - size_t n; +get_nsaddr(size_t n) { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); struct __res_state_ext *_res_extp = _THREAD_PRIVATE(_res_ext, _res_ext, @@ -228,8 +218,7 @@ get_nsaddr(n) * paul vixie, 29may94 */ int -res_isourserver(inp) - const struct sockaddr_in *inp; +res_isourserver(const struct sockaddr_in *inp) { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); #ifdef INET6 @@ -284,17 +273,15 @@ res_isourserver(inp) * paul vixie, 29may94 */ int -res_nameinquery(name, type, class, buf, eom) - const char *name; - register int type, class; - const u_char *buf, *eom; +res_nameinquery(const char *name, int type, int class, const u_char *buf, + const u_char *eom) { - register const u_char *cp = buf + HFIXEDSZ; + const u_char *cp = buf + HFIXEDSZ; int qdcount = ntohs(((HEADER*)buf)->qdcount); while (qdcount-- > 0) { char tname[MAXDNAME+1]; - register int n, ttype, tclass; + int n, ttype, tclass; n = dn_expand(buf, eom, cp, tname, sizeof tname); if (n < 0) @@ -322,18 +309,17 @@ res_nameinquery(name, type, class, buf, eom) * paul vixie, 29may94 */ int -res_queriesmatch(buf1, eom1, buf2, eom2) - const u_char *buf1, *eom1; - const u_char *buf2, *eom2; +res_queriesmatch(const u_char *buf1, const u_char *eom1, const u_char *buf2, + const u_char *eom2) { - register const u_char *cp = buf1 + HFIXEDSZ; + const u_char *cp = buf1 + HFIXEDSZ; int qdcount = ntohs(((HEADER*)buf1)->qdcount); if (qdcount != ntohs(((HEADER*)buf2)->qdcount)) return (0); while (qdcount-- > 0) { char tname[MAXDNAME+1]; - register int n, ttype, tclass; + int n, ttype, tclass; n = dn_expand(buf1, eom1, cp, tname, sizeof tname); if (n < 0) @@ -348,17 +334,13 @@ res_queriesmatch(buf1, eom1, buf2, eom2) } int -res_send(buf, buflen, ans, anssiz) - const u_char *buf; - int buflen; - u_char *ans; - int anssiz; +res_send(const u_char *buf, int buflen, u_char *ans, int anssiz) { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); HEADER *hp = (HEADER *) buf; HEADER *anhp = (HEADER *) ans; int gotsomewhere, connreset, terrno, try, v_circuit, resplen, ns; - register int n; + int n; u_int badns; /* XXX NSMAX can't exceed #/bits in this var */ if ((_resp->options & RES_INIT) == 0 && res_init() == -1) { @@ -885,7 +867,7 @@ read_len: * This routine is not expected to be user visible. */ void -res_close() +res_close(void) { if (s >= 0) { (void) close(s); diff --git a/lib/libc/net/rresvport.c b/lib/libc/net/rresvport.c index 6e4698e3be2..eee872898bd 100644 --- a/lib/libc/net/rresvport.c +++ b/lib/libc/net/rresvport.c @@ -29,7 +29,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: rresvport.c,v 1.6 2003/06/03 02:11:35 deraadt Exp $"; +static char *rcsid = "$OpenBSD: rresvport.c,v 1.7 2005/03/25 13:24:12 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #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 #include <netgroup.h> int -rresvport(alport) - int *alport; +rresvport(int *alport) { return rresvport_af(alport, AF_INET); } int -rresvport_af(alport, af) - int *alport; - int af; +rresvport_af(int *alport, int af) { struct sockaddr_storage ss; struct sockaddr *sa; diff --git a/lib/libc/net/rthdr.c b/lib/libc/net/rthdr.c index 366ca9e6ba0..36ac5a35540 100644 --- a/lib/libc/net/rthdr.c +++ b/lib/libc/net/rthdr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthdr.c,v 1.6 2003/06/11 02:54:02 itojun Exp $ */ +/* $OpenBSD: rthdr.c,v 1.7 2005/03/25 13:24:12 otto Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -40,8 +40,7 @@ #include <stdio.h> size_t -inet6_rthdr_space(type, seg) - int type, seg; +inet6_rthdr_space(int type, int seg) { switch (type) { case IPV6_RTHDR_TYPE_0: @@ -55,9 +54,7 @@ inet6_rthdr_space(type, seg) } struct cmsghdr * -inet6_rthdr_init(bp, type) - void *bp; - int type; +inet6_rthdr_init(void *bp, int type) { struct cmsghdr *ch = (struct cmsghdr *)bp; struct ip6_rthdr *rthdr; @@ -79,10 +76,7 @@ inet6_rthdr_init(bp, type) } int -inet6_rthdr_add(cmsg, addr, flags) - struct cmsghdr *cmsg; - const struct in6_addr *addr; - u_int flags; +inet6_rthdr_add(struct cmsghdr *cmsg, const struct in6_addr *addr, u_int flags) { struct ip6_rthdr *rthdr; @@ -111,9 +105,7 @@ inet6_rthdr_add(cmsg, addr, flags) } int -inet6_rthdr_lasthop(cmsg, flags) - struct cmsghdr *cmsg; - unsigned int flags; +inet6_rthdr_lasthop(struct cmsghdr *cmsg, unsigned int flags) { struct ip6_rthdr *rthdr; @@ -148,8 +140,7 @@ inet6_rthdr_reverse(in, out) #endif int -inet6_rthdr_segments(cmsg) - const struct cmsghdr *cmsg; +inet6_rthdr_segments(const struct cmsghdr *cmsg) { struct ip6_rthdr *rthdr; @@ -172,9 +163,7 @@ inet6_rthdr_segments(cmsg) } struct in6_addr * -inet6_rthdr_getaddr(cmsg, index) - struct cmsghdr *cmsg; - int index; +inet6_rthdr_getaddr(struct cmsghdr *cmsg, int index) { struct ip6_rthdr *rthdr; @@ -200,9 +189,7 @@ inet6_rthdr_getaddr(cmsg, index) } int -inet6_rthdr_getflags(cmsg, index) - const struct cmsghdr *cmsg; - int index; +inet6_rthdr_getflags(const struct cmsghdr *cmsg, int index) { struct ip6_rthdr *rthdr; diff --git a/lib/libc/net/send.c b/lib/libc/net/send.c index 8a7cc74e2dd..f28933369c4 100644 --- a/lib/libc/net/send.c +++ b/lib/libc/net/send.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: send.c,v 1.3 2003/06/02 20:18:36 millert Exp $"; +static char rcsid[] = "$OpenBSD: send.c,v 1.4 2005/03/25 13:24:12 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #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 $" #include <stddef.h> ssize_t -send(s, msg, len, flags) - int s, flags; - size_t len; - const void *msg; +send(int s, const void *msg, size_t len, int flags) { return (sendto(s, msg, len, flags, NULL, 0)); } diff --git a/lib/libc/net/sethostent.c b/lib/libc/net/sethostent.c index 2a8df101d43..2140d65d08b 100644 --- a/lib/libc/net/sethostent.c +++ b/lib/libc/net/sethostent.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: sethostent.c,v 1.6 2003/06/02 20:18:36 millert Exp $"; +static char rcsid[] = "$OpenBSD: sethostent.c,v 1.7 2005/03/25 13:24:12 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -40,8 +40,7 @@ static char rcsid[] = "$OpenBSD: sethostent.c,v 1.6 2003/06/02 20:18:36 millert #include "thread_private.h" void -sethostent(stayopen) - int stayopen; +sethostent(int stayopen) { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); @@ -52,7 +51,7 @@ sethostent(stayopen) } void -endhostent() +endhostent(void) { struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); |