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
This commit is contained in:
parent
2adcf224b0
commit
eaaaad4644
@ -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 *
|
||||
|
@ -71,7 +71,7 @@ char *usage = "bootptest [-h] server-name [vendor-data-template-file]";
|
||||
|
||||
#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. */
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user