bootpd: Use C89 function definitions.

Trim a few duplicate (but incomplete) function prototypes as well.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39520
This commit is contained in:
John Baldwin
2023-04-18 11:21:15 -07:00
parent f6fd5356b3
commit 8b356c8881
16 changed files with 93 additions and 229 deletions
+8 -20
View File
@@ -170,9 +170,7 @@ char *bootpd_dump = DUMPTAB_FILE;
*/ */
int int
main(argc, argv) main(int argc, char **argv)
int argc;
char **argv;
{ {
struct timeval *timeout; struct timeval *timeout;
struct bootp *bp; struct bootp *bp;
@@ -593,8 +591,7 @@ usage()
/* Signal catchers */ /* Signal catchers */
PRIVATE void PRIVATE void
catcher(sig) catcher(int sig)
int sig;
{ {
if (sig == SIGHUP) if (sig == SIGHUP)
do_readtab = 1; do_readtab = 1;
@@ -620,7 +617,7 @@ catcher(sig)
* forward the request there.) * forward the request there.)
*/ */
PRIVATE void PRIVATE void
handle_request() handle_request(void)
{ {
struct bootp *bp = (struct bootp *) pktbuf; struct bootp *bp = (struct bootp *) pktbuf;
struct host *hp = NULL; struct host *hp = NULL;
@@ -998,7 +995,7 @@ HW addr type is IEEE 802. convert to %s and check again\n",
* Process BOOTREPLY packet. * Process BOOTREPLY packet.
*/ */
PRIVATE void PRIVATE void
handle_reply() handle_reply(void)
{ {
if (debug) { if (debug) {
report(LOG_INFO, "processing boot reply"); report(LOG_INFO, "processing boot reply");
@@ -1013,9 +1010,7 @@ handle_reply()
* not the originator of this reply packet. * not the originator of this reply packet.
*/ */
PRIVATE void PRIVATE void
sendreply(forward, dst_override) sendreply(int forward, int32 dst_override)
int forward;
int32 dst_override;
{ {
struct bootp *bp = (struct bootp *) pktbuf; struct bootp *bp = (struct bootp *) pktbuf;
struct in_addr dst; struct in_addr dst;
@@ -1131,9 +1126,7 @@ sendreply(forward, dst_override)
*/ */
PRIVATE int PRIVATE int
chk_access(path, filesize) chk_access(char *path, int32 *filesize)
char *path;
int32 *filesize;
{ {
struct stat st; struct stat st;
@@ -1161,9 +1154,7 @@ chk_access(path, filesize)
*/ */
PRIVATE void PRIVATE void
dovend_cmu(bp, hp) dovend_cmu(struct bootp *bp, struct host *hp)
struct bootp *bp;
struct host *hp;
{ {
struct cmu_vend *vendp; struct cmu_vend *vendp;
struct in_addr_list *taddr; struct in_addr_list *taddr;
@@ -1231,10 +1222,7 @@ dovend_cmu(bp, hp)
return; \ return; \
} while (0) } while (0)
PRIVATE void PRIVATE void
dovend_rfc1048(bp, hp, bootsize) dovend_rfc1048(struct bootp *bp, struct host *hp, int32 bootsize)
struct bootp *bp;
struct host *hp;
int32 bootsize;
{ {
int bytesleft, len; int bytesleft, len;
byte *vp; byte *vp;
+1 -3
View File
@@ -144,9 +144,7 @@ char *hostname;
*/ */
int int
main(argc, argv) main(int argc, char **argv)
int argc;
char **argv;
{ {
struct timeval *timeout; struct timeval *timeout;
struct bootp *bp; struct bootp *bp;
+4 -16
View File
@@ -36,10 +36,7 @@ PRIVATE int insert_generic(struct shared_bindata *, byte **, int *);
*/ */
int int
dovend_rfc1497(hp, buf, len) dovend_rfc1497(struct host *hp, byte *buf, int len)
struct host *hp;
byte *buf;
int len;
{ {
int bytesleft = len; int bytesleft = len;
byte *vp = buf; byte *vp = buf;
@@ -272,11 +269,7 @@ dovend_rfc1497(hp, buf, len)
*/ */
int int
insert_ip(tag, iplist, dest, bytesleft) insert_ip(byte tag, struct in_addr_list *iplist, byte **dest, int *bytesleft)
byte tag;
struct in_addr_list *iplist;
byte **dest;
int *bytesleft;
{ {
struct in_addr *addrptr; struct in_addr *addrptr;
unsigned addrcount = 1; unsigned addrcount = 1;
@@ -315,10 +308,7 @@ insert_ip(tag, iplist, dest, bytesleft)
*/ */
static int static int
insert_generic(gendata, buff, bytesleft) insert_generic(struct shared_bindata *gendata, byte **buff, int *bytesleft)
struct shared_bindata *gendata;
byte **buff;
int *bytesleft;
{ {
byte *srcptr; byte *srcptr;
int length, numbytes; int length, numbytes;
@@ -370,9 +360,7 @@ insert_generic(gendata, buff, bytesleft)
*/ */
void void
insert_u_long(value, dest) insert_u_long(u_int32 value, byte **dest)
u_int32 value;
byte **dest;
{ {
byte *temp; byte *temp;
int n; int n;
+1 -1
View File
@@ -2,5 +2,5 @@
/* $FreeBSD$ */ /* $FreeBSD$ */
extern int dovend_rfc1497(struct host *hp, u_char *buf, int len); extern int dovend_rfc1497(struct host *hp, u_char *buf, int len);
extern int insert_ip(int, struct in_addr_list *, u_char **, int *); extern int insert_ip(byte, struct in_addr_list *, byte **, int *);
extern void insert_u_long(u_int32, u_char **); extern void insert_u_long(u_int32, u_char **);
+5 -13
View File
@@ -29,8 +29,7 @@ static void list_ipaddresses(FILE *, struct in_addr_list *);
#ifndef DEBUG #ifndef DEBUG
void void
dumptab(filename) dumptab(char *filename)
char *filename;
{ {
report(LOG_INFO, "No dumptab support!"); report(LOG_INFO, "No dumptab support!");
} }
@@ -42,8 +41,7 @@ dumptab(filename)
*/ */
void void
dumptab(filename) dumptab(char *filename)
char *filename;
{ {
int n; int n;
struct host *hp; struct host *hp;
@@ -123,9 +121,7 @@ dumptab(filename)
*/ */
static void static void
dump_host(fp, hp) dump_host(FILE *fp, struct host *hp)
FILE *fp;
struct host *hp;
{ {
/* Print symbols in alphabetical order for reader's convenience. */ /* Print symbols in alphabetical order for reader's convenience. */
if (hp) { if (hp) {
@@ -292,9 +288,7 @@ dump_host(fp, hp)
static void static void
dump_generic(fp, generic) dump_generic(FILE *fp, struct shared_bindata *generic)
FILE *fp;
struct shared_bindata *generic;
{ {
u_char *bp = generic->data; u_char *bp = generic->data;
u_char *ep = bp + generic->length; u_char *ep = bp + generic->length;
@@ -337,9 +331,7 @@ dump_generic(fp, generic)
*/ */
static void static void
list_ipaddresses(fp, ipptr) list_ipaddresses(FILE *fp, struct in_addr_list *ipptr)
FILE *fp;
struct in_addr_list *ipptr;
{ {
unsigned count; unsigned count;
struct in_addr *addrptr; struct in_addr *addrptr;
+1 -3
View File
@@ -119,9 +119,7 @@ getether(ifname, eap)
#include <net/if_types.h> #include <net/if_types.h>
int int
getether(ifname, eap) getether(char *ifname, char *eap)
char *ifname; /* interface name from ifconfig structure */
char *eap; /* Ether address (output) */
{ {
int fd, rc = -1; int fd, rc = -1;
int n; int n;
+2 -5
View File
@@ -40,9 +40,7 @@ static int nmatch(u_char *ca, u_char *cb);
/* Return a pointer to the interface struct for the passed address. */ /* Return a pointer to the interface struct for the passed address. */
struct ifreq * struct ifreq *
getif(s, addrp) getif(int s, struct in_addr *addrp)
int s; /* socket file descriptor */
struct in_addr *addrp; /* destination address on interface */
{ {
int maxmatch; int maxmatch;
int len, m, incr; int len, m, incr;
@@ -110,8 +108,7 @@ getif(s, addrp)
* internet addresses supplied. * internet addresses supplied.
*/ */
static int static int
nmatch(ca, cb) nmatch(u_char *ca, u_char *cb)
u_char *ca, *cb; /* ptrs to IP address, network order */
{ {
u_int m = 0; /* count of matching bits */ u_int m = 0; /* count of matching bits */
u_int n = 4; /* bytes left, then bitmask */ u_int n = 4; /* bytes left, then bitmask */
+14 -36
View File
@@ -69,8 +69,7 @@ PRIVATE void hashi_FreeMembers(hash_member *, hash_freefp);
*/ */
hash_tbl * hash_tbl *
hash_Init(tablesize) hash_Init(unsigned tablesize)
unsigned tablesize;
{ {
hash_tbl *hashtblptr; hash_tbl *hashtblptr;
unsigned totalsize; unsigned totalsize;
@@ -99,9 +98,7 @@ hash_Init(tablesize)
*/ */
PRIVATE void PRIVATE void
hashi_FreeMembers(bucketptr, free_data) hashi_FreeMembers(hash_member *bucketptr, hash_freefp free_data)
hash_member *bucketptr;
hash_freefp free_data;
{ {
hash_member *nextbucket; hash_member *nextbucket;
while (bucketptr) { while (bucketptr) {
@@ -121,9 +118,7 @@ hashi_FreeMembers(bucketptr, free_data)
*/ */
void void
hash_Reset(hashtable, free_data) hash_Reset(hash_tbl *hashtable, hash_freefp free_data)
hash_tbl *hashtable;
hash_freefp free_data;
{ {
hash_member **bucketptr; hash_member **bucketptr;
unsigned i; unsigned i;
@@ -160,9 +155,7 @@ hash_Reset(hashtable, free_data)
*/ */
unsigned unsigned
hash_HashFunction(string, len) hash_HashFunction(unsigned char *string, unsigned len)
unsigned char *string;
unsigned len;
{ {
unsigned accum; unsigned accum;
@@ -182,11 +175,8 @@ hash_HashFunction(string, len)
*/ */
int int
hash_Exists(hashtable, hashcode, compare, key) hash_Exists(hash_tbl *hashtable, unsigned hashcode, hash_cmpfp compare,
hash_tbl *hashtable; hash_datum *key)
unsigned hashcode;
hash_cmpfp compare;
hash_datum *key;
{ {
hash_member *memberptr; hash_member *memberptr;
@@ -213,11 +203,8 @@ hash_Exists(hashtable, hashcode, compare, key)
*/ */
int int
hash_Insert(hashtable, hashcode, compare, key, element) hash_Insert(hash_tbl *hashtable, unsigned hashcode, hash_cmpfp compare,
hash_tbl *hashtable; hash_datum *key, hash_datum *element)
unsigned hashcode;
hash_cmpfp compare;
hash_datum *key, *element;
{ {
hash_member *temp; hash_member *temp;
@@ -244,12 +231,8 @@ hash_Insert(hashtable, hashcode, compare, key, element)
*/ */
int int
hash_Delete(hashtable, hashcode, compare, key, free_data) hash_Delete(hash_tbl *hashtable, unsigned hashcode, hash_cmpfp compare,
hash_tbl *hashtable; hash_datum *key, hash_freefp free_data)
unsigned hashcode;
hash_cmpfp compare;
hash_datum *key;
hash_freefp free_data;
{ {
hash_member *memberptr, *tempptr; hash_member *memberptr, *tempptr;
hash_member *previous = NULL; hash_member *previous = NULL;
@@ -310,11 +293,8 @@ hash_Delete(hashtable, hashcode, compare, key, free_data)
*/ */
hash_datum * hash_datum *
hash_Lookup(hashtable, hashcode, compare, key) hash_Lookup(hash_tbl *hashtable, unsigned hashcode, hash_cmpfp compare,
hash_tbl *hashtable; hash_datum *key)
unsigned hashcode;
hash_cmpfp compare;
hash_datum *key;
{ {
hash_member *memberptr; hash_member *memberptr;
@@ -335,8 +315,7 @@ hash_Lookup(hashtable, hashcode, compare, key)
*/ */
hash_datum * hash_datum *
hash_NextEntry(hashtable) hash_NextEntry(hash_tbl *hashtable)
hash_tbl *hashtable;
{ {
unsigned bucket; unsigned bucket;
hash_member *memberptr; hash_member *memberptr;
@@ -388,8 +367,7 @@ hash_NextEntry(hashtable)
*/ */
hash_datum * hash_datum *
hash_FirstEntry(hashtable) hash_FirstEntry(hash_tbl *hashtable)
hash_tbl *hashtable;
{ {
hashtable->bucketnum = 0; hashtable->bucketnum = 0;
hashtable->member = (hashtable->table)[0]; hashtable->member = (hashtable->table)[0];
+6 -15
View File
@@ -81,12 +81,7 @@ int hwinfocnt = sizeof(hwinfolist) / sizeof(hwinfolist[0]);
* bound to hardware address 'ha' of length 'len'. * bound to hardware address 'ha' of length 'len'.
*/ */
void void
setarp(s, ia, hafamily, haddr, halen) setarp(int s, struct in_addr *ia, int hafamily, u_char *haddr, int halen)
int s; /* socket fd */
struct in_addr *ia; /* protocol address */
int hafamily; /* HW address family */
u_char *haddr; /* HW address data */
int halen;
{ {
#ifdef SIOCSARP #ifdef SIOCSARP
#ifdef WIN_TCP #ifdef WIN_TCP
@@ -207,9 +202,7 @@ setarp(s, ia, hafamily, haddr, halen)
* Convert a hardware address to an ASCII string. * Convert a hardware address to an ASCII string.
*/ */
char * char *
haddrtoa(haddr, hlen) haddrtoa(u_char *haddr, int hlen)
u_char *haddr;
int hlen;
{ {
static char haddrbuf[3 * MAXHADDRLEN + 1]; static char haddrbuf[3 * MAXHADDRLEN + 1];
char *bufptr; char *bufptr;
@@ -286,9 +279,7 @@ static u_char conv802table[256] =
}; };
void void
haddr_conv802(addr_in, addr_out, len) haddr_conv802(u_char *addr_in, u_char *addr_out, int len)
u_char *addr_in, *addr_out;
int len;
{ {
u_char *lim; u_char *lim;
@@ -303,8 +294,7 @@ haddr_conv802(addr_in, addr_out, len)
* bit-reverse table above. * bit-reverse table above.
*/ */
static int static int
bitrev(n) bitrev(int n)
int n;
{ {
int i, r; int i, r;
@@ -317,7 +307,8 @@ bitrev(n)
return r; return r;
} }
main() void
main(void)
{ {
int i; int i;
for (i = 0; i <= 0xFF; i++) { for (i = 0; i <= 0xFF; i++) {
+5 -10
View File
@@ -13,7 +13,6 @@
#ifdef ETC_ETHERS #ifdef ETC_ETHERS
#include <net/ethernet.h> #include <net/ethernet.h>
extern int ether_hostton();
#endif #endif
#include <netdb.h> #include <netdb.h>
@@ -29,9 +28,7 @@ extern int ether_hostton();
* Return NULL if addr not found. * Return NULL if addr not found.
*/ */
u_char * u_char *
lookup_hwa(hostname, htype) lookup_hwa(char *hostname, int htype)
char *hostname;
int htype;
{ {
switch (htype) { switch (htype) {
@@ -65,9 +62,7 @@ lookup_hwa(hostname, htype)
* Return non-zero on failure. * Return non-zero on failure.
*/ */
int int
lookup_ipa(hostname, result) lookup_ipa(char *hostname, u_int32 *result)
char *hostname;
u_int32 *result;
{ {
struct hostent *hp; struct hostent *hp;
hp = gethostbyname(hostname); hp = gethostbyname(hostname);
@@ -85,11 +80,11 @@ lookup_ipa(hostname, result)
* XXX - This is OK as a default, but to really make this automatic, * XXX - This is OK as a default, but to really make this automatic,
* we would need to get the subnet mask from the ether interface. * we would need to get the subnet mask from the ether interface.
* If this is wrong, specify the correct value in the bootptab. * If this is wrong, specify the correct value in the bootptab.
*
* Both arguments are in network order
*/ */
int int
lookup_netmask(addr, result) lookup_netmask(u_int32 addr, u_int32 *result)
u_int32 addr; /* both in network order */
u_int32 *result;
{ {
int32 m, a; int32 m, a;
+28 -67
View File
@@ -219,7 +219,6 @@ PRIVATE struct htypename htnamemap[] = {
* Externals and forward declarations. * Externals and forward declarations.
*/ */
extern boolean iplookcmp();
boolean nmcmp(hash_datum *, hash_datum *); boolean nmcmp(hash_datum *, hash_datum *);
PRIVATE void PRIVATE void
@@ -288,7 +287,7 @@ hash_tbl *nmhashtable;
* (shared by bootpd and bootpef) * (shared by bootpd and bootpef)
*/ */
void void
rdtab_init() rdtab_init(void)
{ {
hwhashtable = hash_Init(HASHTABLESIZE); hwhashtable = hash_Init(HASHTABLESIZE);
iphashtable = hash_Init(HASHTABLESIZE); iphashtable = hash_Init(HASHTABLESIZE);
@@ -306,8 +305,7 @@ rdtab_init()
*/ */
void void
readtab(force) readtab(int force)
int force;
{ {
struct host *hp; struct host *hp;
FILE *fp; FILE *fp;
@@ -489,10 +487,7 @@ readtab(force)
*/ */
PRIVATE void PRIVATE void
read_entry(fp, buffer, bufsiz) read_entry(FILE *fp, char *buffer, unsigned *bufsiz)
FILE *fp;
char *buffer;
unsigned *bufsiz;
{ {
int c, length; int c, length;
@@ -629,9 +624,7 @@ read_entry(fp, buffer, bufsiz)
*/ */
PRIVATE int PRIVATE int
process_entry(host, src) process_entry(struct host *host, char *src)
struct host *host;
char *src;
{ {
int retval; int retval;
char *msg; char *msg;
@@ -775,9 +768,7 @@ process_entry(host, src)
* Obviously, this need a few more comments. . . . * Obviously, this need a few more comments. . . .
*/ */
PRIVATE int PRIVATE int
eval_symbol(symbol, hp) eval_symbol(char **symbol, struct host *hp)
char **symbol;
struct host *hp;
{ {
char tmpstr[MAXSTRINGLEN]; char tmpstr[MAXSTRINGLEN];
byte *tmphaddr; byte *tmphaddr;
@@ -1149,9 +1140,7 @@ eval_symbol(symbol, hp)
*/ */
PRIVATE char * PRIVATE char *
get_string(src, dest, length) get_string(char **src, char *dest, unsigned *length)
char **src, *dest;
unsigned *length;
{ {
int n, len, quoteflag; int n, len, quoteflag;
@@ -1201,8 +1190,7 @@ get_string(src, dest, length)
*/ */
PRIVATE struct shared_string * PRIVATE struct shared_string *
get_shared_string(src) get_shared_string(char **src)
char **src;
{ {
char retstring[MAXSTRINGLEN]; char retstring[MAXSTRINGLEN];
struct shared_string *s; struct shared_string *s;
@@ -1238,10 +1226,7 @@ get_shared_string(src)
*/ */
PRIVATE int PRIVATE int
process_generic(src, dest, tagvalue) process_generic(char **src, struct shared_bindata **dest, u_int tagvalue)
char **src;
struct shared_bindata **dest;
u_int tagvalue;
{ {
byte tmpbuf[MAXBUFLEN]; byte tmpbuf[MAXBUFLEN];
byte *str; byte *str;
@@ -1296,8 +1281,7 @@ process_generic(src, dest, tagvalue)
*/ */
PRIVATE boolean PRIVATE boolean
goodname(hostname) goodname(char *hostname)
char *hostname;
{ {
do { do {
if (!isalpha(*hostname++)) { /* First character must be a letter */ if (!isalpha(*hostname++)) { /* First character must be a letter */
@@ -1329,8 +1313,7 @@ goodname(hostname)
*/ */
PRIVATE boolean PRIVATE boolean
nullcmp(d1, d2) nullcmp(hash_datum *d1, hash_datum *d2)
hash_datum *d1, *d2;
{ {
return FALSE; return FALSE;
} }
@@ -1342,8 +1325,7 @@ nullcmp(d1, d2)
*/ */
boolean boolean
nmcmp(d1, d2) nmcmp(hash_datum *d1, hash_datum *d2)
hash_datum *d1, *d2;
{ {
char *name = (char *) d1; /* XXX - OK? */ char *name = (char *) d1; /* XXX - OK? */
struct host *hp = (struct host *) d2; struct host *hp = (struct host *) d2;
@@ -1365,8 +1347,7 @@ nmcmp(d1, d2)
*/ */
PRIVATE boolean PRIVATE boolean
hwinscmp(d1, d2) hwinscmp(hash_datum *d1, hash_datum *d2)
hash_datum *d1, *d2;
{ {
struct host *host1 = (struct host *) d1; struct host *host1 = (struct host *) d1;
struct host *host2 = (struct host *) d2; struct host *host2 = (struct host *) d2;
@@ -1421,9 +1402,7 @@ hwinscmp(d1, d2)
* current host entry are inferred from the template entry. * current host entry are inferred from the template entry.
*/ */
PRIVATE void PRIVATE void
fill_defaults(hp, src) fill_defaults(struct host *hp, char **src)
struct host *hp;
char **src;
{ {
unsigned int tlen, hashcode; unsigned int tlen, hashcode;
struct host *hp2; struct host *hp2;
@@ -1513,8 +1492,7 @@ fill_defaults(hp, src)
*/ */
PRIVATE void PRIVATE void
adjust(s) adjust(char **s)
char **s;
{ {
char *t; char *t;
@@ -1538,8 +1516,7 @@ adjust(s)
*/ */
PRIVATE void PRIVATE void
eat_whitespace(s) eat_whitespace(char **s)
char **s;
{ {
char *t; char *t;
@@ -1557,8 +1534,7 @@ eat_whitespace(s)
*/ */
PRIVATE void PRIVATE void
makelower(s) makelower(char *s)
char *s;
{ {
while (*s) { while (*s) {
if (isupper(*s)) { if (isupper(*s)) {
@@ -1598,8 +1574,7 @@ makelower(s)
*/ */
PRIVATE struct in_addr_list * PRIVATE struct in_addr_list *
get_addresses(src) get_addresses(char **src)
char **src;
{ {
struct in_addr tmpaddrlist[MAXINADDRS]; struct in_addr tmpaddrlist[MAXINADDRS];
struct in_addr *address1, *address2; struct in_addr *address1, *address2;
@@ -1655,9 +1630,7 @@ get_addresses(src)
*/ */
PRIVATE int PRIVATE int
prs_inetaddr(src, result) prs_inetaddr(char **src, u_int32 *result)
char **src;
u_int32 *result;
{ {
char tmpstr[MAXSTRINGLEN]; char tmpstr[MAXSTRINGLEN];
u_int32 value; u_int32 value;
@@ -1755,9 +1728,7 @@ prs_inetaddr(src, result)
*/ */
PRIVATE byte * PRIVATE byte *
prs_haddr(src, htype) prs_haddr(char **src, u_int htype)
char **src;
u_int htype;
{ {
static byte haddr[MAXHADDRLEN]; static byte haddr[MAXHADDRLEN];
byte *hap; byte *hap;
@@ -1810,9 +1781,7 @@ prs_haddr(src, htype)
*/ */
PRIVATE int PRIVATE int
interp_byte(src, retbyte) interp_byte(char **src, byte *retbyte)
char **src;
byte *retbyte;
{ {
int v; int v;
@@ -1842,8 +1811,7 @@ interp_byte(src, retbyte)
*/ */
PRIVATE u_int32 PRIVATE u_int32
get_u_long(src) get_u_long(char **src)
char **src;
{ {
u_int32 value, base; u_int32 value, base;
char c; char c;
@@ -1891,8 +1859,7 @@ get_u_long(src)
*/ */
PRIVATE void PRIVATE void
free_host(hmp) free_host(hash_datum *hmp)
hash_datum *hmp;
{ {
struct host *hostptr = (struct host *) hmp; struct host *hostptr = (struct host *) hmp;
if (hostptr == NULL) if (hostptr == NULL)
@@ -1948,8 +1915,7 @@ free_host(hmp)
*/ */
PRIVATE void PRIVATE void
del_iplist(iplist) del_iplist(struct in_addr_list *iplist)
struct in_addr_list *iplist;
{ {
if (iplist) { if (iplist) {
if (!(--(iplist->linkcount))) { if (!(--(iplist->linkcount))) {
@@ -1967,8 +1933,7 @@ del_iplist(iplist)
*/ */
PRIVATE void PRIVATE void
del_string(stringptr) del_string(struct shared_string *stringptr)
struct shared_string *stringptr;
{ {
if (stringptr) { if (stringptr) {
if (!(--(stringptr->linkcount))) { if (!(--(stringptr->linkcount))) {
@@ -1986,8 +1951,7 @@ del_string(stringptr)
*/ */
PRIVATE void PRIVATE void
del_bindata(dataptr) del_bindata(struct shared_bindata *dataptr)
struct shared_bindata *dataptr;
{ {
if (dataptr) { if (dataptr) {
if (!(--(dataptr->linkcount))) { if (!(--(dataptr->linkcount))) {
@@ -2008,8 +1972,7 @@ del_bindata(dataptr)
*/ */
PRIVATE char * PRIVATE char *
smalloc(nbytes) smalloc(unsigned nbytes)
unsigned nbytes;
{ {
char *retvalue; char *retvalue;
@@ -2033,8 +1996,7 @@ smalloc(nbytes)
*/ */
boolean boolean
hwlookcmp(d1, d2) hwlookcmp(hash_datum *d1, hash_datum *d2)
hash_datum *d1, *d2;
{ {
struct host *host1 = (struct host *) d1; struct host *host1 = (struct host *) d1;
struct host *host2 = (struct host *) d2; struct host *host2 = (struct host *) d2;
@@ -2054,8 +2016,7 @@ hwlookcmp(d1, d2)
*/ */
boolean boolean
iplookcmp(d1, d2) iplookcmp(hash_datum *d1, hash_datum *d2)
hash_datum *d1, *d2;
{ {
struct host *host1 = (struct host *) d1; struct host *host1 = (struct host *) d1;
struct host *host2 = (struct host *) d2; struct host *host2 = (struct host *) d2;
+2 -3
View File
@@ -33,8 +33,7 @@ extern char *progname;
static int stderr_only = 1; static int stderr_only = 1;
void void
report_init(nolog) report_init(int nolog)
int nolog;
{ {
stderr_only = nolog; stderr_only = nolog;
#ifdef SYSLOG #ifdef SYSLOG
@@ -120,7 +119,7 @@ report(int priority, const char *fmt,...)
* Return pointer to static string which gives full filesystem error message. * Return pointer to static string which gives full filesystem error message.
*/ */
const char * const char *
get_errmsg() get_errmsg(void)
{ {
return strerror(errno); return strerror(errno);
} }
+4 -6
View File
@@ -115,10 +115,8 @@ static struct {
/* /*
* Set an individual arp entry * Set an individual arp entry
*/ */
int bsd_arp_set(ia, eaddr, len) int
struct in_addr *ia; bsd_arp_set(struct in_addr *ia, char *eaddr, int len)
char *eaddr;
int len;
{ {
struct sockaddr_in *sin = &sin_m; struct sockaddr_in *sin = &sin_m;
struct sockaddr_dl *sdl; struct sockaddr_dl *sdl;
@@ -176,8 +174,8 @@ int bsd_arp_set(ia, eaddr, len)
} }
static int rtmsg(cmd) static int
int cmd; rtmsg(int cmd)
{ {
static int seq; static int seq;
int rlen; int rlen;
+3 -6
View File
@@ -100,7 +100,7 @@ char *bootptab = CONFIG_FILE;
* Print "usage" message and exit * Print "usage" message and exit
*/ */
static void static void
usage() usage(void)
{ {
fprintf(stderr, fprintf(stderr,
"usage: $s [ -c chdir ] [-d level] [-f configfile] [host...]\n"); "usage: $s [ -c chdir ] [-d level] [-f configfile] [host...]\n");
@@ -116,9 +116,7 @@ usage()
* main server loop is started. * main server loop is started.
*/ */
int int
main(argc, argv) main(int argc, char **argv)
int argc;
char **argv;
{ {
struct host *hp; struct host *hp;
char *stmp; char *stmp;
@@ -262,8 +260,7 @@ main(argc, argv)
*/ */
static void static void
mktagfile(hp) mktagfile(struct host *hp)
struct host *hp;
{ {
FILE *fp; FILE *fp;
int bytesleft, len; int bytesleft, len;
+4 -9
View File
@@ -128,9 +128,7 @@ short secs; /* How long client has waited */
*/ */
int int
main(argc, argv) main(int argc, char **argv)
int argc;
char **argv;
{ {
struct bootp *bp; struct bootp *bp;
struct servent *sep; struct servent *sep;
@@ -439,8 +437,7 @@ main(argc, argv)
} }
static void static void
send_request(s) send_request(int s)
int s;
{ {
/* Print the request packet. */ /* Print the request packet. */
printf("Sending to %s", inet_ntoa(sin_server.sin_addr)); printf("Sending to %s", inet_ntoa(sin_server.sin_addr));
@@ -462,8 +459,7 @@ send_request(s)
* Return true if truncated. * Return true if truncated.
*/ */
int int
printfn(s, ep) printfn(u_char *s, u_char *ep)
u_char *s, *ep;
{ {
u_char c; u_char c;
@@ -493,8 +489,7 @@ printfn(s, ep)
* (like inet_ntoa, but ina is a pointer) * (like inet_ntoa, but ina is a pointer)
*/ */
char * char *
ipaddr_string(ina) ipaddr_string(struct in_addr *ina)
struct in_addr *ina;
{ {
static char b[24]; static char b[24];
u_char *p; u_char *p;
+5 -16
View File
@@ -53,10 +53,7 @@ static void dump_hex(u_char *bp, int len);
* Print bootp requests * Print bootp requests
*/ */
void void
bootp_print(bp, length, sport, dport) bootp_print(struct bootp *bp, int length, u_short sport, u_short dport)
struct bootp *bp;
int length;
u_short sport, dport;
{ {
static char tstr[] = " [|bootp]"; static char tstr[] = " [|bootp]";
static unsigned char vm_cmu[4] = VM_CMU; static unsigned char vm_cmu[4] = VM_CMU;
@@ -274,9 +271,7 @@ rfc1048_opts[] = {
#define KNOWN_OPTIONS (sizeof(rfc1048_opts) / sizeof(rfc1048_opts[0])) #define KNOWN_OPTIONS (sizeof(rfc1048_opts) / sizeof(rfc1048_opts[0]))
static void static void
rfc1048_print(bp, length) rfc1048_print(u_char *bp, int length)
u_char *bp;
int length;
{ {
u_char tag; u_char tag;
u_char *ep; u_char *ep;
@@ -376,9 +371,7 @@ rfc1048_print(bp, length)
} }
static void static void
cmu_print(bp, length) cmu_print(u_char *bp, int length)
u_char *bp;
int length;
{ {
struct cmu_vend *v; struct cmu_vend *v;
@@ -424,9 +417,7 @@ cmu_print(bp, length)
*/ */
static void static void
other_print(bp, length) other_print(u_char *bp, int length)
u_char *bp;
int length;
{ {
u_char *ep; /* end pointer */ u_char *ep; /* end pointer */
u_char *zp; /* points one past last non-zero byte */ u_char *zp; /* points one past last non-zero byte */
@@ -464,9 +455,7 @@ other_print(bp, length)
} }
static void static void
dump_hex(bp, len) dump_hex(u_char *bp, int len)
u_char *bp;
int len;
{ {
while (len > 0) { while (len > 0) {
printf("%02X", *bp); printf("%02X", *bp);