From nobody Tue Apr 18 18:31:27 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q1CDb5cSfz45Trs; Tue, 18 Apr 2023 18:31:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q1CDb4kVyz41PD; Tue, 18 Apr 2023 18:31:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681842687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fO3NgbalIPRRAXXlsT6CLzi/PdvpCKQPSn0+dnbgZa0=; b=V21J2SxuhHnpv4mkULymZE/DG4lMk/ktmxvFGMAnd3yci8ffEP2DcscaxuC5xowk7AlTwm gle1RgiVu8SKfU7gllDcpfMckA+HF4oOjJeRJmJs1k4rzuP3fYUWxuGbhfOY8UalPZU88x L1bMd3VCouSAFlSbAoEiZsY2relp4f7cxpTmZA8JdEvQ939RzGj//GQ09b5LO+hEZcH1CN SnwwQPTJE/02ySAVdsuLS5e7wPzXQ5kniPkP8hc3ROeYshMyQ5nI6lTVS7jDfb3IcP+HBr REIr/EoAvq8IEeyrYKFyKQGoEtxblwGt2Lc0wsIPE/XCLHv2tIzeCGT7fMj4eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681842687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fO3NgbalIPRRAXXlsT6CLzi/PdvpCKQPSn0+dnbgZa0=; b=w7IPiEoLP0RVyKSXe9jctoZnAZ6p8BK9gB5uGw10KVcMA3c7sk8kJvIjRTXP2pTr58sXlF k/cpp07NGVtO7tK94v/rFvX8nE7syOWHiruuvO89UjxINoBHQ/KRpu4cKJCuzPqeqJg3tT 5YB8aslwKB0OzZxf1QWBf2AC3kXe8sFD+sLqoXBtGoIv0eWY0z/HMERjywU6LwAgxUOBeO 8URlYA6fh+SW9dX7pCB5SESNT7RF6kH3Niyb4lQAAnR2xZPL4VXwClTY0JcdqHDJwq/NEC mA6LNA6/6fQVTCeD7yfm68j+yfeET6CpnJZA+PTtiSpPHbp0HTapgiy2G8EO3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681842687; a=rsa-sha256; cv=none; b=lEuiiOG6O+PoAp+EUCKDsu5otKHXdxRcNfpcgp34EFRgUiZd+h0BJzfsvJxoE6KS+u+0vp 3SLgV8YKmoPZgmXICLdvfidsFEjikGyjrL2u6t2ilzKEiXKdQFp3xpZR1m+sNQbA7Ihqpt EUlLpIRHyPLokqoh33JgJ3G/Ms7KkOdSCBwxKIuyqkuQmLOaj+E/QaBqCsRZvHAAD5Q+qL WMISCVpxGVf3WHI/cJ6YkLSw6/LALstgSxp7tz4Tu2OvCQr5q3sqZZGond+2YlpwkTbz4K EmpJWkAI2j0jWLlK6P43YwuYHk1qo4cWtP9jljmI2Isxjlo6GfnMNzj9Y5bQCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q1CDb3YcnzNQf; Tue, 18 Apr 2023 18:31:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33IIVRBv026535; Tue, 18 Apr 2023 18:31:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33IIVRW3026534; Tue, 18 Apr 2023 18:31:27 GMT (envelope-from git) Date: Tue, 18 Apr 2023 18:31:27 GMT Message-Id: <202304181831.33IIVRW3026534@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 8b356c888167 - main - bootpd: Use C89 function definitions. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b356c888167dfc5f5783679d373555053982f02 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8b356c888167dfc5f5783679d373555053982f02 commit 8b356c888167dfc5f5783679d373555053982f02 Author: John Baldwin AuthorDate: 2023-04-18 18:21:15 +0000 Commit: John Baldwin CommitDate: 2023-04-18 18:21:15 +0000 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 --- libexec/bootpd/bootpd.c | 28 +++----- libexec/bootpd/bootpgw/bootpgw.c | 4 +- libexec/bootpd/dovend.c | 20 ++---- libexec/bootpd/dovend.h | 2 +- libexec/bootpd/dumptab.c | 18 ++---- libexec/bootpd/getether.c | 4 +- libexec/bootpd/getif.c | 7 +- libexec/bootpd/hash.c | 50 ++++----------- libexec/bootpd/hwaddr.c | 21 ++---- libexec/bootpd/lookup.c | 15 ++--- libexec/bootpd/readfile.c | 95 ++++++++-------------------- libexec/bootpd/report.c | 5 +- libexec/bootpd/rtmsg.c | 10 ++- libexec/bootpd/tools/bootpef/bootpef.c | 9 +-- libexec/bootpd/tools/bootptest/bootptest.c | 13 ++-- libexec/bootpd/tools/bootptest/print-bootp.c | 21 ++---- 16 files changed, 93 insertions(+), 229 deletions(-) diff --git a/libexec/bootpd/bootpd.c b/libexec/bootpd/bootpd.c index 42f1cd8c5912..938444127f45 100644 --- a/libexec/bootpd/bootpd.c +++ b/libexec/bootpd/bootpd.c @@ -170,9 +170,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; @@ -593,8 +591,7 @@ usage() /* Signal catchers */ PRIVATE void -catcher(sig) - int sig; +catcher(int sig) { if (sig == SIGHUP) do_readtab = 1; @@ -620,7 +617,7 @@ catcher(sig) * forward the request there.) */ PRIVATE void -handle_request() +handle_request(void) { struct bootp *bp = (struct bootp *) pktbuf; struct host *hp = NULL; @@ -998,7 +995,7 @@ null_file_name: * Process BOOTREPLY packet. */ PRIVATE void -handle_reply() +handle_reply(void) { if (debug) { report(LOG_INFO, "processing boot reply"); @@ -1013,9 +1010,7 @@ handle_reply() * not the originator of this reply packet. */ PRIVATE void -sendreply(forward, dst_override) - int forward; - int32 dst_override; +sendreply(int forward, int32 dst_override) { struct bootp *bp = (struct bootp *) pktbuf; struct in_addr dst; @@ -1131,9 +1126,7 @@ sendreply(forward, dst_override) */ PRIVATE int -chk_access(path, filesize) - char *path; - int32 *filesize; +chk_access(char *path, int32 *filesize) { struct stat st; @@ -1161,9 +1154,7 @@ chk_access(path, filesize) */ PRIVATE void -dovend_cmu(bp, hp) - struct bootp *bp; - struct host *hp; +dovend_cmu(struct bootp *bp, struct host *hp) { struct cmu_vend *vendp; struct in_addr_list *taddr; @@ -1231,10 +1222,7 @@ dovend_cmu(bp, hp) return; \ } while (0) PRIVATE void -dovend_rfc1048(bp, hp, bootsize) - struct bootp *bp; - struct host *hp; - int32 bootsize; +dovend_rfc1048(struct bootp *bp, struct host *hp, int32 bootsize) { int bytesleft, len; byte *vp; diff --git a/libexec/bootpd/bootpgw/bootpgw.c b/libexec/bootpd/bootpgw/bootpgw.c index 3c128c03a9a6..c0042ccb1de3 100644 --- a/libexec/bootpd/bootpgw/bootpgw.c +++ b/libexec/bootpd/bootpgw/bootpgw.c @@ -144,9 +144,7 @@ char *hostname; */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { struct timeval *timeout; struct bootp *bp; diff --git a/libexec/bootpd/dovend.c b/libexec/bootpd/dovend.c index 65543a2700c0..a90e63cfa4d9 100644 --- a/libexec/bootpd/dovend.c +++ b/libexec/bootpd/dovend.c @@ -36,10 +36,7 @@ PRIVATE int insert_generic(struct shared_bindata *, byte **, int *); */ int -dovend_rfc1497(hp, buf, len) - struct host *hp; - byte *buf; - int len; +dovend_rfc1497(struct host *hp, byte *buf, int len) { int bytesleft = len; byte *vp = buf; @@ -272,11 +269,7 @@ dovend_rfc1497(hp, buf, len) */ int -insert_ip(tag, iplist, dest, bytesleft) - byte tag; - struct in_addr_list *iplist; - byte **dest; - int *bytesleft; +insert_ip(byte tag, struct in_addr_list *iplist, byte **dest, int *bytesleft) { struct in_addr *addrptr; unsigned addrcount = 1; @@ -315,10 +308,7 @@ insert_ip(tag, iplist, dest, bytesleft) */ static int -insert_generic(gendata, buff, bytesleft) - struct shared_bindata *gendata; - byte **buff; - int *bytesleft; +insert_generic(struct shared_bindata *gendata, byte **buff, int *bytesleft) { byte *srcptr; int length, numbytes; @@ -370,9 +360,7 @@ insert_generic(gendata, buff, bytesleft) */ void -insert_u_long(value, dest) - u_int32 value; - byte **dest; +insert_u_long(u_int32 value, byte **dest) { byte *temp; int n; diff --git a/libexec/bootpd/dovend.h b/libexec/bootpd/dovend.h index ef3b62de7126..77cdfc376fb4 100644 --- a/libexec/bootpd/dovend.h +++ b/libexec/bootpd/dovend.h @@ -2,5 +2,5 @@ /* $FreeBSD$ */ 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 **); diff --git a/libexec/bootpd/dumptab.c b/libexec/bootpd/dumptab.c index daab93f609a6..b7f98a8d3eca 100644 --- a/libexec/bootpd/dumptab.c +++ b/libexec/bootpd/dumptab.c @@ -29,8 +29,7 @@ static void list_ipaddresses(FILE *, struct in_addr_list *); #ifndef DEBUG void -dumptab(filename) - char *filename; +dumptab(char *filename) { report(LOG_INFO, "No dumptab support!"); } @@ -42,8 +41,7 @@ dumptab(filename) */ void -dumptab(filename) - char *filename; +dumptab(char *filename) { int n; struct host *hp; @@ -123,9 +121,7 @@ dumptab(filename) */ static void -dump_host(fp, hp) - FILE *fp; - struct host *hp; +dump_host(FILE *fp, struct host *hp) { /* Print symbols in alphabetical order for reader's convenience. */ if (hp) { @@ -292,9 +288,7 @@ dump_host(fp, hp) static void -dump_generic(fp, generic) - FILE *fp; - struct shared_bindata *generic; +dump_generic(FILE *fp, struct shared_bindata *generic) { u_char *bp = generic->data; u_char *ep = bp + generic->length; @@ -337,9 +331,7 @@ dump_generic(fp, generic) */ static void -list_ipaddresses(fp, ipptr) - FILE *fp; - struct in_addr_list *ipptr; +list_ipaddresses(FILE *fp, struct in_addr_list *ipptr) { unsigned count; struct in_addr *addrptr; diff --git a/libexec/bootpd/getether.c b/libexec/bootpd/getether.c index 56b7c8ed3016..a43536fd83f5 100644 --- a/libexec/bootpd/getether.c +++ b/libexec/bootpd/getether.c @@ -119,9 +119,7 @@ getether(ifname, eap) #include int -getether(ifname, eap) - char *ifname; /* interface name from ifconfig structure */ - char *eap; /* Ether address (output) */ +getether(char *ifname, char *eap) { int fd, rc = -1; int n; diff --git a/libexec/bootpd/getif.c b/libexec/bootpd/getif.c index 225647ea439b..9d7502512cb3 100644 --- a/libexec/bootpd/getif.c +++ b/libexec/bootpd/getif.c @@ -40,9 +40,7 @@ static int nmatch(u_char *ca, u_char *cb); /* Return a pointer to the interface struct for the passed address. */ struct ifreq * -getif(s, addrp) - int s; /* socket file descriptor */ - struct in_addr *addrp; /* destination address on interface */ +getif(int s, struct in_addr *addrp) { int maxmatch; int len, m, incr; @@ -110,8 +108,7 @@ getif(s, addrp) * internet addresses supplied. */ static int -nmatch(ca, cb) - u_char *ca, *cb; /* ptrs to IP address, network order */ +nmatch(u_char *ca, u_char *cb) { u_int m = 0; /* count of matching bits */ u_int n = 4; /* bytes left, then bitmask */ diff --git a/libexec/bootpd/hash.c b/libexec/bootpd/hash.c index 1641a8a092cd..89b113bc6031 100644 --- a/libexec/bootpd/hash.c +++ b/libexec/bootpd/hash.c @@ -69,8 +69,7 @@ PRIVATE void hashi_FreeMembers(hash_member *, hash_freefp); */ hash_tbl * -hash_Init(tablesize) - unsigned tablesize; +hash_Init(unsigned tablesize) { hash_tbl *hashtblptr; unsigned totalsize; @@ -99,9 +98,7 @@ hash_Init(tablesize) */ PRIVATE void -hashi_FreeMembers(bucketptr, free_data) - hash_member *bucketptr; - hash_freefp free_data; +hashi_FreeMembers(hash_member *bucketptr, hash_freefp free_data) { hash_member *nextbucket; while (bucketptr) { @@ -121,9 +118,7 @@ hashi_FreeMembers(bucketptr, free_data) */ void -hash_Reset(hashtable, free_data) - hash_tbl *hashtable; - hash_freefp free_data; +hash_Reset(hash_tbl *hashtable, hash_freefp free_data) { hash_member **bucketptr; unsigned i; @@ -160,9 +155,7 @@ hash_Reset(hashtable, free_data) */ unsigned -hash_HashFunction(string, len) - unsigned char *string; - unsigned len; +hash_HashFunction(unsigned char *string, unsigned len) { unsigned accum; @@ -182,11 +175,8 @@ hash_HashFunction(string, len) */ int -hash_Exists(hashtable, hashcode, compare, key) - hash_tbl *hashtable; - unsigned hashcode; - hash_cmpfp compare; - hash_datum *key; +hash_Exists(hash_tbl *hashtable, unsigned hashcode, hash_cmpfp compare, + hash_datum *key) { hash_member *memberptr; @@ -213,11 +203,8 @@ hash_Exists(hashtable, hashcode, compare, key) */ int -hash_Insert(hashtable, hashcode, compare, key, element) - hash_tbl *hashtable; - unsigned hashcode; - hash_cmpfp compare; - hash_datum *key, *element; +hash_Insert(hash_tbl *hashtable, unsigned hashcode, hash_cmpfp compare, + hash_datum *key, hash_datum *element) { hash_member *temp; @@ -244,12 +231,8 @@ hash_Insert(hashtable, hashcode, compare, key, element) */ int -hash_Delete(hashtable, hashcode, compare, key, free_data) - hash_tbl *hashtable; - unsigned hashcode; - hash_cmpfp compare; - hash_datum *key; - hash_freefp free_data; +hash_Delete(hash_tbl *hashtable, unsigned hashcode, hash_cmpfp compare, + hash_datum *key, hash_freefp free_data) { hash_member *memberptr, *tempptr; hash_member *previous = NULL; @@ -310,11 +293,8 @@ hash_Delete(hashtable, hashcode, compare, key, free_data) */ hash_datum * -hash_Lookup(hashtable, hashcode, compare, key) - hash_tbl *hashtable; - unsigned hashcode; - hash_cmpfp compare; - hash_datum *key; +hash_Lookup(hash_tbl *hashtable, unsigned hashcode, hash_cmpfp compare, + hash_datum *key) { hash_member *memberptr; @@ -335,8 +315,7 @@ hash_Lookup(hashtable, hashcode, compare, key) */ hash_datum * -hash_NextEntry(hashtable) - hash_tbl *hashtable; +hash_NextEntry(hash_tbl *hashtable) { unsigned bucket; hash_member *memberptr; @@ -388,8 +367,7 @@ hash_NextEntry(hashtable) */ hash_datum * -hash_FirstEntry(hashtable) - hash_tbl *hashtable; +hash_FirstEntry(hash_tbl *hashtable) { hashtable->bucketnum = 0; hashtable->member = (hashtable->table)[0]; diff --git a/libexec/bootpd/hwaddr.c b/libexec/bootpd/hwaddr.c index 293c75a6b3be..7e0400014864 100644 --- a/libexec/bootpd/hwaddr.c +++ b/libexec/bootpd/hwaddr.c @@ -81,12 +81,7 @@ int hwinfocnt = sizeof(hwinfolist) / sizeof(hwinfolist[0]); * bound to hardware address 'ha' of length 'len'. */ void -setarp(s, ia, hafamily, haddr, halen) - int s; /* socket fd */ - struct in_addr *ia; /* protocol address */ - int hafamily; /* HW address family */ - u_char *haddr; /* HW address data */ - int halen; +setarp(int s, struct in_addr *ia, int hafamily, u_char *haddr, int halen) { #ifdef SIOCSARP #ifdef WIN_TCP @@ -207,9 +202,7 @@ setarp(s, ia, hafamily, haddr, halen) * Convert a hardware address to an ASCII string. */ char * -haddrtoa(haddr, hlen) - u_char *haddr; - int hlen; +haddrtoa(u_char *haddr, int hlen) { static char haddrbuf[3 * MAXHADDRLEN + 1]; char *bufptr; @@ -286,9 +279,7 @@ static u_char conv802table[256] = }; void -haddr_conv802(addr_in, addr_out, len) - u_char *addr_in, *addr_out; - int len; +haddr_conv802(u_char *addr_in, u_char *addr_out, int len) { u_char *lim; @@ -303,8 +294,7 @@ haddr_conv802(addr_in, addr_out, len) * bit-reverse table above. */ static int -bitrev(n) - int n; +bitrev(int n) { int i, r; @@ -317,7 +307,8 @@ bitrev(n) return r; } -main() +void +main(void) { int i; for (i = 0; i <= 0xFF; i++) { diff --git a/libexec/bootpd/lookup.c b/libexec/bootpd/lookup.c index 391a1d826d6e..0287f71d9075 100644 --- a/libexec/bootpd/lookup.c +++ b/libexec/bootpd/lookup.c @@ -13,7 +13,6 @@ #ifdef ETC_ETHERS #include -extern int ether_hostton(); #endif #include @@ -29,9 +28,7 @@ extern int ether_hostton(); * Return NULL if addr not found. */ u_char * -lookup_hwa(hostname, htype) - char *hostname; - int htype; +lookup_hwa(char *hostname, int htype) { switch (htype) { @@ -65,9 +62,7 @@ lookup_hwa(hostname, htype) * Return non-zero on failure. */ int -lookup_ipa(hostname, result) - char *hostname; - u_int32 *result; +lookup_ipa(char *hostname, u_int32 *result) { struct hostent *hp; hp = gethostbyname(hostname); @@ -85,11 +80,11 @@ lookup_ipa(hostname, result) * 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. * If this is wrong, specify the correct value in the bootptab. + * + * Both arguments are in network order */ int -lookup_netmask(addr, result) - u_int32 addr; /* both in network order */ - u_int32 *result; +lookup_netmask(u_int32 addr, u_int32 *result) { int32 m, a; diff --git a/libexec/bootpd/readfile.c b/libexec/bootpd/readfile.c index c09639300310..8511dd1bb18f 100644 --- a/libexec/bootpd/readfile.c +++ b/libexec/bootpd/readfile.c @@ -219,7 +219,6 @@ PRIVATE struct htypename htnamemap[] = { * Externals and forward declarations. */ -extern boolean iplookcmp(); boolean nmcmp(hash_datum *, hash_datum *); PRIVATE void @@ -288,7 +287,7 @@ hash_tbl *nmhashtable; * (shared by bootpd and bootpef) */ void -rdtab_init() +rdtab_init(void) { hwhashtable = hash_Init(HASHTABLESIZE); iphashtable = hash_Init(HASHTABLESIZE); @@ -306,8 +305,7 @@ rdtab_init() */ void -readtab(force) - int force; +readtab(int force) { struct host *hp; FILE *fp; @@ -489,10 +487,7 @@ readtab(force) */ PRIVATE void -read_entry(fp, buffer, bufsiz) - FILE *fp; - char *buffer; - unsigned *bufsiz; +read_entry(FILE *fp, char *buffer, unsigned *bufsiz) { int c, length; @@ -629,9 +624,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; @@ -775,9 +768,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; @@ -1149,9 +1140,7 @@ eval_symbol(symbol, hp) */ PRIVATE char * -get_string(src, dest, length) - char **src, *dest; - unsigned *length; +get_string(char **src, char *dest, unsigned *length) { int n, len, quoteflag; @@ -1201,8 +1190,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; @@ -1238,10 +1226,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; @@ -1296,8 +1281,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 */ @@ -1329,8 +1313,7 @@ goodname(hostname) */ PRIVATE boolean -nullcmp(d1, d2) - hash_datum *d1, *d2; +nullcmp(hash_datum *d1, hash_datum *d2) { return FALSE; } @@ -1342,8 +1325,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; @@ -1365,8 +1347,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; @@ -1421,9 +1402,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; @@ -1513,8 +1492,7 @@ fill_defaults(hp, src) */ PRIVATE void -adjust(s) - char **s; +adjust(char **s) { char *t; @@ -1538,8 +1516,7 @@ adjust(s) */ PRIVATE void -eat_whitespace(s) - char **s; +eat_whitespace(char **s) { char *t; @@ -1557,8 +1534,7 @@ eat_whitespace(s) */ PRIVATE void -makelower(s) - char *s; +makelower(char *s) { while (*s) { if (isupper(*s)) { @@ -1598,8 +1574,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; @@ -1655,9 +1630,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; @@ -1755,9 +1728,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; @@ -1810,9 +1781,7 @@ prs_haddr(src, htype) */ PRIVATE int -interp_byte(src, retbyte) - char **src; - byte *retbyte; +interp_byte(char **src, byte *retbyte) { int v; @@ -1842,8 +1811,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; @@ -1891,8 +1859,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) @@ -1948,8 +1915,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))) { @@ -1967,8 +1933,7 @@ del_iplist(iplist) */ PRIVATE void -del_string(stringptr) - struct shared_string *stringptr; +del_string(struct shared_string *stringptr) { if (stringptr) { if (!(--(stringptr->linkcount))) { @@ -1986,8 +1951,7 @@ del_string(stringptr) */ PRIVATE void -del_bindata(dataptr) - struct shared_bindata *dataptr; +del_bindata(struct shared_bindata *dataptr) { if (dataptr) { if (!(--(dataptr->linkcount))) { @@ -2008,8 +1972,7 @@ del_bindata(dataptr) */ PRIVATE char * -smalloc(nbytes) - unsigned nbytes; +smalloc(unsigned nbytes) { char *retvalue; @@ -2033,8 +1996,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; @@ -2054,8 +2016,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/libexec/bootpd/report.c b/libexec/bootpd/report.c index 290e19e74063..98f24bb2950c 100644 --- a/libexec/bootpd/report.c +++ b/libexec/bootpd/report.c @@ -33,8 +33,7 @@ extern char *progname; static int stderr_only = 1; void -report_init(nolog) - int nolog; +report_init(int nolog) { stderr_only = nolog; #ifdef SYSLOG @@ -120,7 +119,7 @@ report(int priority, const char *fmt,...) * Return pointer to static string which gives full filesystem error message. */ const char * -get_errmsg() +get_errmsg(void) { return strerror(errno); } diff --git a/libexec/bootpd/rtmsg.c b/libexec/bootpd/rtmsg.c index a689a5ac139f..c02735649236 100644 --- a/libexec/bootpd/rtmsg.c +++ b/libexec/bootpd/rtmsg.c @@ -115,10 +115,8 @@ static struct { /* * Set an individual arp entry */ -int bsd_arp_set(ia, eaddr, len) - struct in_addr *ia; - char *eaddr; - int len; +int +bsd_arp_set(struct in_addr *ia, char *eaddr, int len) { struct sockaddr_in *sin = &sin_m; struct sockaddr_dl *sdl; @@ -176,8 +174,8 @@ overwrite: } -static int rtmsg(cmd) - int cmd; +static int +rtmsg(int cmd) { static int seq; int rlen; diff --git a/libexec/bootpd/tools/bootpef/bootpef.c b/libexec/bootpd/tools/bootpef/bootpef.c index 7ed3786d892e..2fb928f3065d 100644 --- a/libexec/bootpd/tools/bootpef/bootpef.c +++ b/libexec/bootpd/tools/bootpef/bootpef.c @@ -100,7 +100,7 @@ char *bootptab = CONFIG_FILE; * Print "usage" message and exit */ static void -usage() +usage(void) { fprintf(stderr, "usage: $s [ -c chdir ] [-d level] [-f configfile] [host...]\n"); @@ -116,9 +116,7 @@ usage() * main server loop is started. */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { struct host *hp; char *stmp; @@ -262,8 +260,7 @@ main(argc, argv) */ static void -mktagfile(hp) - struct host *hp; +mktagfile(struct host *hp) { FILE *fp; int bytesleft, len; diff --git a/libexec/bootpd/tools/bootptest/bootptest.c b/libexec/bootpd/tools/bootptest/bootptest.c index b99ac49a735e..5e7d61fc52b6 100644 --- a/libexec/bootpd/tools/bootptest/bootptest.c +++ b/libexec/bootpd/tools/bootptest/bootptest.c @@ -128,9 +128,7 @@ short secs; /* How long client has waited */ */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { struct bootp *bp; struct servent *sep; @@ -439,8 +437,7 @@ main(argc, argv) } static void -send_request(s) - int s; +send_request(int s) { /* Print the request packet. */ printf("Sending to %s", inet_ntoa(sin_server.sin_addr)); @@ -462,8 +459,7 @@ send_request(s) * Return true if truncated. */ int -printfn(s, ep) - u_char *s, *ep; +printfn(u_char *s, u_char *ep) { u_char c; @@ -493,8 +489,7 @@ printfn(s, ep) * (like inet_ntoa, but ina is a pointer) */ char * -ipaddr_string(ina) - struct in_addr *ina; +ipaddr_string(struct in_addr *ina) { static char b[24]; u_char *p; diff --git a/libexec/bootpd/tools/bootptest/print-bootp.c b/libexec/bootpd/tools/bootptest/print-bootp.c index c7a5a4400b37..5d7670ce1f24 100644 --- a/libexec/bootpd/tools/bootptest/print-bootp.c +++ b/libexec/bootpd/tools/bootptest/print-bootp.c @@ -53,10 +53,7 @@ static void dump_hex(u_char *bp, int len); * Print bootp requests */ void -bootp_print(bp, length, sport, dport) - struct bootp *bp; - int length; - u_short sport, dport; +bootp_print(struct bootp *bp, int length, u_short sport, u_short dport) { static char tstr[] = " [|bootp]"; static unsigned char vm_cmu[4] = VM_CMU; @@ -274,9 +271,7 @@ rfc1048_opts[] = { #define KNOWN_OPTIONS (sizeof(rfc1048_opts) / sizeof(rfc1048_opts[0])) static void -rfc1048_print(bp, length) - u_char *bp; - int length; +rfc1048_print(u_char *bp, int length) *** 36 LINES SKIPPED ***