From owner-svn-src-head@freebsd.org Sun Mar 26 14:37:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3147D1E0F9; Sun, 26 Mar 2017 14:37:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 702D3191F; Sun, 26 Mar 2017 14:37:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QEbCIb017603; Sun, 26 Mar 2017 14:37:12 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QEbCp9017599; Sun, 26 Mar 2017 14:37:12 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201703261437.v2QEbCp9017599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sun, 26 Mar 2017 14:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315987 - in head/libexec/bootpd: . tools/bootptest X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 14:37:13 -0000 Author: rwatson Date: Sun Mar 26 14:37:12 2017 New Revision: 315987 URL: https://svnweb.freebsd.org/changeset/base/315987 Log: Emply contemporary function prototypes in bootpd, rather than relying on locally defined K&R prototypes in .c files; use appropriate casts for pointer types now that types for arguments are available at compile time. This ensures that compilers with multiple incompatible calling conventions can select the correct calling convention for external functions. Sponsored by: DARPA, AFRL MFC after: 1 week Modified: head/libexec/bootpd/getif.c head/libexec/bootpd/tools/bootptest/bootptest.c head/libexec/bootpd/tools/bootptest/bootptest.h head/libexec/bootpd/tools/bootptest/print-bootp.c Modified: head/libexec/bootpd/getif.c ============================================================================== --- head/libexec/bootpd/getif.c Sun Mar 26 14:31:29 2017 (r315986) +++ head/libexec/bootpd/getif.c Sun Mar 26 14:37:12 2017 (r315987) @@ -36,7 +36,7 @@ static struct ifreq ifreq[10]; /* Holds interface configuration */ static struct ifconf ifconf; /* points to ifreq */ -static int nmatch(); +static int nmatch(u_char *ca, u_char *cb); /* Return a pointer to the interface struct for the passed address. */ struct ifreq * Modified: head/libexec/bootpd/tools/bootptest/bootptest.c ============================================================================== --- head/libexec/bootpd/tools/bootptest/bootptest.c Sun Mar 26 14:31:29 2017 (r315986) +++ head/libexec/bootpd/tools/bootptest/bootptest.c Sun Mar 26 14:37:12 2017 (r315987) @@ -71,7 +71,7 @@ char *usage = "bootptest [-h] server-nam #include "patchlevel.h" -static void send_request(); +static void send_request(int s); #define LOG_ERR 1 #define BUFLEN 1024 @@ -122,9 +122,6 @@ unsigned char vm_cmu[4] = VM_CMU; unsigned char vm_rfc1048[4] = VM_RFC1048; short secs; /* How long client has waited */ -char *get_errmsg(); -extern void bootp_print(); - /* * Initialization such as command-line processing is done, then * the receiver loop is started. Die when interrupted. @@ -429,7 +426,7 @@ main(argc, argv) /* set globals needed by bootp_print() */ snaplen = n; snapend = (unsigned char *) rcvbuf + snaplen; - bootp_print(rcvbuf, n, sin_from.sin_port, 0); + bootp_print((struct bootp *)rcvbuf, n, sin_from.sin_port, 0); putchar('\n'); /* * This no longer exits immediately after receiving @@ -447,7 +444,7 @@ send_request(s) { /* Print the request packet. */ printf("Sending to %s", inet_ntoa(sin_server.sin_addr)); - bootp_print(sndbuf, snaplen, sin_from.sin_port, 0); + bootp_print((struct bootp *)sndbuf, snaplen, sin_from.sin_port, 0); putchar('\n'); /* Send the request packet. */ Modified: head/libexec/bootpd/tools/bootptest/bootptest.h ============================================================================== --- head/libexec/bootpd/tools/bootptest/bootptest.h Sun Mar 26 14:31:29 2017 (r315986) +++ head/libexec/bootpd/tools/bootptest/bootptest.h Sun Mar 26 14:37:12 2017 (r315987) @@ -20,4 +20,7 @@ extern int vflag; /* verbose flag */ extern unsigned char *packetp; extern unsigned char *snapend; -extern char *ipaddr_string(struct in_addr *); +void bootp_print(struct bootp *bp, int length, u_short sport, + u_short dport); +char *ipaddr_string(struct in_addr *); +int printfn(u_char *s, u_char *ep); Modified: head/libexec/bootpd/tools/bootptest/print-bootp.c ============================================================================== --- head/libexec/bootpd/tools/bootptest/print-bootp.c Sun Mar 26 14:31:29 2017 (r315986) +++ head/libexec/bootpd/tools/bootptest/print-bootp.c Sun Mar 26 14:37:12 2017 (r315987) @@ -42,11 +42,10 @@ #include "bootptest.h" /* These decode the vendor data. */ -extern int printfn(); -static void rfc1048_print(); -static void cmu_print(); -static void other_print(); -static void dump_hex(); +static void rfc1048_print(u_char *bp, int length); +static void cmu_print(u_char *bp, int length); +static void other_print(u_char *bp, int length); +static void dump_hex(u_char *bp, int len); /* * Print bootp requests