summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-07-08 20:41:14 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-07-08 20:41:14 +0000
commit2b6e5e780f141b8c3ef70950a01f6bee7e89d07a (patch)
treec0cab45b05fdb1f1ec1eee91307adc1e7e0a841a /usr.sbin
parent60d1f85c13d6867b79ca4c9babe26f1104a4df42 (diff)
protos; avsm ok
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bootpd/bootpd.c8
-rw-r--r--usr.sbin/bootpd/bootpd.h9
-rw-r--r--usr.sbin/bootpd/dumptab.c3
-rw-r--r--usr.sbin/bootpd/getif.c6
-rw-r--r--usr.sbin/bootpd/hwaddr.c2
-rw-r--r--usr.sbin/bootpd/lookup.c1
-rw-r--r--usr.sbin/bootpd/readfile.c98
-rw-r--r--usr.sbin/bootpd/report.c20
-rw-r--r--usr.sbin/bootpd/trygetea.c3
-rw-r--r--usr.sbin/bootpd/trygetif.c3
-rw-r--r--usr.sbin/bootpd/trylook.c3
-rw-r--r--usr.sbin/bootpd/tzone.c2
-rw-r--r--usr.sbin/bootpd/tzone.h2
13 files changed, 54 insertions, 106 deletions
diff --git a/usr.sbin/bootpd/bootpd.c b/usr.sbin/bootpd/bootpd.c
index 153ffe9c8c3..7587924539c 100644
--- a/usr.sbin/bootpd/bootpd.c
+++ b/usr.sbin/bootpd/bootpd.c
@@ -21,7 +21,7 @@ SOFTWARE.
************************************************************************/
#ifndef lint
-static char rcsid[] = "$Id: bootpd.c,v 1.12 2002/09/08 08:06:40 deraadt Exp $";
+static char rcsid[] = "$Id: bootpd.c,v 1.13 2003/07/08 20:41:13 deraadt Exp $";
#endif
/*
@@ -114,8 +114,6 @@ static char rcsid[] = "$Id: bootpd.c,v 1.12 2002/09/08 08:06:40 deraadt Exp $";
#define P(args) ()
#endif
-extern void dumptab P((char *));
-
PRIVATE void catcher P((int));
PRIVATE int chk_access P((char *, int32 *));
#ifdef VEND_CMU
@@ -186,9 +184,7 @@ char *bootpd_dump = DUMPTAB_FILE;
*/
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
struct timeval *timeout;
struct bootp *bp;
diff --git a/usr.sbin/bootpd/bootpd.h b/usr.sbin/bootpd/bootpd.h
index 11c4a8b41d6..dacbd716ac0 100644
--- a/usr.sbin/bootpd/bootpd.h
+++ b/usr.sbin/bootpd/bootpd.h
@@ -209,3 +209,12 @@ extern hash_tbl *hwhashtable;
extern hash_tbl *iphashtable;
extern hash_tbl *nmhashtable;
+#ifdef __STDC__
+#define P(args) args
+#else
+#define P(args) ()
+#endif
+
+void dumptab P((char *filename));
+
+#undef P
diff --git a/usr.sbin/bootpd/dumptab.c b/usr.sbin/bootpd/dumptab.c
index b9baccac157..3017666d6a3 100644
--- a/usr.sbin/bootpd/dumptab.c
+++ b/usr.sbin/bootpd/dumptab.c
@@ -53,8 +53,7 @@ dumptab(filename)
*/
void
-dumptab(filename)
- char *filename;
+dumptab(char *filename)
{
int n;
struct host *hp;
diff --git a/usr.sbin/bootpd/getif.c b/usr.sbin/bootpd/getif.c
index ba0a00bdd0f..1b37de879bd 100644
--- a/usr.sbin/bootpd/getif.c
+++ b/usr.sbin/bootpd/getif.c
@@ -34,7 +34,7 @@
static struct ifreq ifreq[10]; /* Holds interface configuration */
static struct ifconf ifconf; /* points to ifreq */
-static int nmatch();
+static int nmatch(void *, void *);
/* Return a pointer to the interface struct for the passed address. */
struct ifreq *
@@ -109,9 +109,9 @@ getif(s, addrp)
* internet addresses supplied.
*/
static int
-nmatch(ca, cb)
- u_char *ca, *cb; /* ptrs to IP address, network order */
+nmatch(void *va, void *vb) /* ptrs to IP address, network order */
{
+ u_char *ca = va, *cb = vb; /* ptrs to IP address, network order */
u_int m = 0; /* count of matching bits */
u_int n = 4; /* bytes left, then bitmask */
diff --git a/usr.sbin/bootpd/hwaddr.c b/usr.sbin/bootpd/hwaddr.c
index 4f3e88e2153..626ecf98cb7 100644
--- a/usr.sbin/bootpd/hwaddr.c
+++ b/usr.sbin/bootpd/hwaddr.c
@@ -19,6 +19,7 @@
#include <net/if_arp.h>
#include <netinet/in.h>
+#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#ifndef NO_UNISTD
@@ -131,7 +132,6 @@ setarp(s, ia, ha, len)
int status;
char buf[256];
char *a;
- extern char *inet_ntoa();
a = inet_ntoa(*ia);
snprintf(buf, sizeof(buf), "(arp -d %s; arp -s %s %s temp) "
diff --git a/usr.sbin/bootpd/lookup.c b/usr.sbin/bootpd/lookup.c
index 2a30a59b2c3..db8bd8b7ffe 100644
--- a/usr.sbin/bootpd/lookup.c
+++ b/usr.sbin/bootpd/lookup.c
@@ -10,7 +10,6 @@
#ifdef ETC_ETHERS
#include <netinet/if_ether.h>
-extern int ether_hostton();
#endif
#include <netdb.h>
diff --git a/usr.sbin/bootpd/readfile.c b/usr.sbin/bootpd/readfile.c
index abf4a27ae03..4114e038144 100644
--- a/usr.sbin/bootpd/readfile.c
+++ b/usr.sbin/bootpd/readfile.c
@@ -21,7 +21,7 @@ SOFTWARE.
************************************************************************/
#ifndef lint
-static char rcsid[] = "$Id: readfile.c,v 1.8 2003/03/13 09:09:45 deraadt Exp $";
+static char rcsid[] = "$Id: readfile.c,v 1.9 2003/07/08 20:41:13 deraadt Exp $";
#endif
@@ -235,7 +235,7 @@ PRIVATE struct htypename htnamemap[] = {
#define P(args) ()
#endif
-extern boolean iplookcmp();
+extern boolean iplookcmp(hash_datum *, hash_datum *);
boolean nmcmp P((hash_datum *, hash_datum *));
PRIVATE void
@@ -306,7 +306,7 @@ hash_tbl *nmhashtable;
* (shared by bootpd and bootpef)
*/
void
-rdtab_init()
+rdtab_init(void)
{
hwhashtable = hash_Init(HASHTABLESIZE);
iphashtable = hash_Init(HASHTABLESIZE);
@@ -324,8 +324,7 @@ rdtab_init()
*/
void
-readtab(force)
- int force;
+readtab(int force)
{
struct host *hp;
FILE *fp;
@@ -507,10 +506,7 @@ readtab(force)
*/
PRIVATE void
-read_entry(fp, buffer, bufsiz)
- FILE *fp;
- char *buffer;
- unsigned int *bufsiz;
+read_entry(FILE *fp, char *buffer, unsigned int *bufsiz)
{
int c, length;
@@ -646,9 +642,7 @@ read_entry(fp, buffer, bufsiz)
*/
PRIVATE int
-process_entry(host, src)
- struct host *host;
- char *src;
+process_entry(struct host *host, char *src)
{
int retval;
char *msg;
@@ -790,9 +784,7 @@ process_entry(host, src)
* Obviously, this need a few more comments. . . .
*/
PRIVATE int
-eval_symbol(symbol, hp)
- char **symbol;
- struct host *hp;
+eval_symbol(char **symbol, struct host *hp)
{
char tmpstr[MAXSTRINGLEN];
byte *tmphaddr;
@@ -1165,9 +1157,7 @@ eval_symbol(symbol, hp)
*/
PRIVATE char *
-get_string(src, dest, length)
- char **src, *dest;
- unsigned int *length;
+get_string(char **src, char *dest, unsigned int *length)
{
int n, len, quoteflag;
@@ -1217,8 +1207,7 @@ get_string(src, dest, length)
*/
PRIVATE struct shared_string *
-get_shared_string(src)
- char **src;
+get_shared_string(char **src)
{
char retstring[MAXSTRINGLEN];
struct shared_string *s;
@@ -1255,10 +1244,7 @@ get_shared_string(src)
*/
PRIVATE int
-process_generic(src, dest, tagvalue)
- char **src;
- struct shared_bindata **dest;
- u_int tagvalue;
+process_generic(char **src, struct shared_bindata **dest, u_int tagvalue)
{
byte tmpbuf[MAXBUFLEN];
byte *str;
@@ -1313,8 +1299,7 @@ process_generic(src, dest, tagvalue)
*/
PRIVATE boolean
-goodname(hostname)
- char *hostname;
+goodname(char *hostname)
{
do {
if (!isalpha(*hostname++)) { /* First character must be a letter */
@@ -1346,8 +1331,7 @@ goodname(hostname)
*/
PRIVATE boolean
-nullcmp(d1, d2)
- hash_datum *d1, *d2;
+nullcmp(hash_datum *d1, hash_datum *d2)
{
return FALSE;
}
@@ -1359,8 +1343,7 @@ nullcmp(d1, d2)
*/
boolean
-nmcmp(d1, d2)
- hash_datum *d1, *d2;
+nmcmp(hash_datum *d1, hash_datum *d2)
{
char *name = (char *) d1; /* XXX - OK? */
struct host *hp = (struct host *) d2;
@@ -1382,8 +1365,7 @@ nmcmp(d1, d2)
*/
PRIVATE boolean
-hwinscmp(d1, d2)
- hash_datum *d1, *d2;
+hwinscmp(hash_datum *d1, hash_datum *d2)
{
struct host *host1 = (struct host *) d1;
struct host *host2 = (struct host *) d2;
@@ -1438,9 +1420,7 @@ hwinscmp(d1, d2)
* current host entry are inferred from the template entry.
*/
PRIVATE void
-fill_defaults(hp, src)
- struct host *hp;
- char **src;
+fill_defaults(struct host *hp, char **src)
{
unsigned int tlen, hashcode;
struct host *hp2;
@@ -1530,8 +1510,7 @@ fill_defaults(hp, src)
*/
PRIVATE void
-adjust(s)
- char **s;
+adjust(char **s)
{
char *t;
@@ -1555,8 +1534,7 @@ adjust(s)
*/
PRIVATE void
-eat_whitespace(s)
- char **s;
+eat_whitespace(char **s)
{
char *t;
@@ -1574,8 +1552,7 @@ eat_whitespace(s)
*/
PRIVATE void
-makelower(s)
- char *s;
+makelower(char *s)
{
while (*s) {
if (isupper(*s)) {
@@ -1615,8 +1592,7 @@ makelower(s)
*/
PRIVATE struct in_addr_list *
-get_addresses(src)
- char **src;
+get_addresses(char **src)
{
struct in_addr tmpaddrlist[MAXINADDRS];
struct in_addr *address1, *address2;
@@ -1672,9 +1648,7 @@ get_addresses(src)
*/
PRIVATE int
-prs_inetaddr(src, result)
- char **src;
- u_int32 *result;
+prs_inetaddr(char **src, u_int32 *result)
{
char tmpstr[MAXSTRINGLEN];
u_int32 value;
@@ -1774,9 +1748,7 @@ prs_inetaddr(src, result)
*/
PRIVATE byte *
-prs_haddr(src, htype)
- char **src;
- u_int htype;
+prs_haddr(char **src, u_int htype)
{
static byte haddr[MAXHADDRLEN];
byte *hap;
@@ -1831,9 +1803,7 @@ prs_haddr(src, htype)
*/
PRIVATE int
-interp_byte(src, retbyte)
- char **src;
- byte *retbyte;
+interp_byte(char **src, byte *retbyte)
{
int v;
@@ -1863,8 +1833,7 @@ interp_byte(src, retbyte)
*/
PRIVATE u_int32
-get_u_long(src)
- char **src;
+get_u_long(char **src)
{
u_int32 value, base;
char c;
@@ -1912,8 +1881,7 @@ get_u_long(src)
*/
PRIVATE void
-free_host(hmp)
- hash_datum *hmp;
+free_host(hash_datum *hmp)
{
struct host *hostptr = (struct host *) hmp;
if (hostptr == NULL)
@@ -1969,8 +1937,7 @@ free_host(hmp)
*/
PRIVATE void
-del_iplist(iplist)
- struct in_addr_list *iplist;
+del_iplist(struct in_addr_list *iplist)
{
if (iplist) {
if (!(--(iplist->linkcount))) {
@@ -1988,8 +1955,7 @@ del_iplist(iplist)
*/
PRIVATE void
-del_string(stringptr)
- struct shared_string *stringptr;
+del_string(struct shared_string *stringptr)
{
if (stringptr) {
if (!(--(stringptr->linkcount))) {
@@ -2007,8 +1973,7 @@ del_string(stringptr)
*/
PRIVATE void
-del_bindata(dataptr)
- struct shared_bindata *dataptr;
+del_bindata(struct shared_bindata *dataptr)
{
if (dataptr) {
if (!(--(dataptr->linkcount))) {
@@ -2029,8 +1994,7 @@ del_bindata(dataptr)
*/
PRIVATE char *
-smalloc(nbytes)
- unsigned int nbytes;
+smalloc(unsigned int nbytes)
{
char *retvalue;
@@ -2054,8 +2018,7 @@ smalloc(nbytes)
*/
boolean
-hwlookcmp(d1, d2)
- hash_datum *d1, *d2;
+hwlookcmp(hash_datum *d1, hash_datum *d2)
{
struct host *host1 = (struct host *) d1;
struct host *host2 = (struct host *) d2;
@@ -2075,8 +2038,7 @@ hwlookcmp(d1, d2)
*/
boolean
-iplookcmp(d1, d2)
- hash_datum *d1, *d2;
+iplookcmp(hash_datum *d1, hash_datum *d2)
{
struct host *host1 = (struct host *) d1;
struct host *host2 = (struct host *) d2;
diff --git a/usr.sbin/bootpd/report.c b/usr.sbin/bootpd/report.c
index 204c4bd5093..8e2bf5a8029 100644
--- a/usr.sbin/bootpd/report.c
+++ b/usr.sbin/bootpd/report.c
@@ -9,6 +9,7 @@
#endif
#include <stdio.h>
+#include <string.h>
#include <syslog.h>
#include "report.h"
@@ -33,8 +34,7 @@ extern char *progname;
static int stderr_only = 1;
void
-report_init(nolog)
- int nolog;
+report_init(int nolog)
{
stderr_only = nolog;
#ifdef SYSLOG
@@ -88,17 +88,8 @@ static int numlevels = sizeof(levelnames) / sizeof(levelnames[0]);
* Print a log message using syslog(3) and/or stderr.
* The message passed in should not include a newline.
*/
-#ifdef __STDC__
void
report(int priority, char *fmt,...)
-#else
-/*VARARGS2*/
-void
-report(priority, fmt, va_alist)
- int priority;
- char *fmt;
- va_dcl
-#endif
{
va_list ap;
static char buf[256];
@@ -106,11 +97,7 @@ report(priority, fmt, va_alist)
if ((priority < 0) || (priority >= numlevels)) {
priority = numlevels - 1;
}
-#ifdef __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
@@ -133,10 +120,9 @@ report(priority, fmt, va_alist)
* Return pointer to static string which gives full filesystem error message.
*/
char *
-get_errmsg()
+get_errmsg(void)
{
extern int errno;
- extern char *strerror();
return strerror(errno);
}
diff --git a/usr.sbin/bootpd/trygetea.c b/usr.sbin/bootpd/trygetea.c
index e69120d3f8d..473c121f5f0 100644
--- a/usr.sbin/bootpd/trygetea.c
+++ b/usr.sbin/bootpd/trygetea.c
@@ -22,8 +22,7 @@ int debug = 0;
char *progname;
int
-main(argc, argv)
- char **argv;
+main(int argc, char *argv[])
{
u_char ea[16]; /* Ethernet address */
int i;
diff --git a/usr.sbin/bootpd/trygetif.c b/usr.sbin/bootpd/trygetif.c
index 59cef539fa3..c57ccd14b62 100644
--- a/usr.sbin/bootpd/trygetif.c
+++ b/usr.sbin/bootpd/trygetif.c
@@ -24,8 +24,7 @@ int debug = 0;
char *progname;
int
-main(argc, argv)
- char **argv;
+main(int argc, char *argv[])
{
struct hostent *hep;
struct sockaddr ea; /* Ethernet address */
diff --git a/usr.sbin/bootpd/trylook.c b/usr.sbin/bootpd/trylook.c
index 24349cb3d03..03ecb8f77a2 100644
--- a/usr.sbin/bootpd/trylook.c
+++ b/usr.sbin/bootpd/trylook.c
@@ -16,8 +16,7 @@ int debug = 0;
char *progname;
int
-main(argc, argv)
- char **argv;
+main(int argc, char *argv[])
{
int i;
struct in_addr in;
diff --git a/usr.sbin/bootpd/tzone.c b/usr.sbin/bootpd/tzone.c
index 526764e5bae..4e499b66531 100644
--- a/usr.sbin/bootpd/tzone.c
+++ b/usr.sbin/bootpd/tzone.c
@@ -28,7 +28,7 @@ int32 secondswest;
* configuration file doesn't specify one.
*/
void
-tzone_init()
+tzone_init(void)
{
#ifdef SVR4
/* XXX - Is this really SunOS specific? -gwr */
diff --git a/usr.sbin/bootpd/tzone.h b/usr.sbin/bootpd/tzone.h
index ddd67c4b625..e8f28fa1eb0 100644
--- a/usr.sbin/bootpd/tzone.h
+++ b/usr.sbin/bootpd/tzone.h
@@ -1,3 +1,3 @@
/* tzone.h */
extern int32 secondswest;
-extern void tzone_init();
+extern void tzone_init(void);