mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-23 19:28:36 +00:00
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:
parent
f6fd5356b3
commit
8b356c8881
|
@ -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 @@ HW addr type is IEEE 802. convert to %s and check again\n",
|
|||
* 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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 **);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -119,9 +119,7 @@ getether(ifname, eap)
|
|||
#include <net/if_types.h>
|
||||
|
||||
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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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++) {
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
|
||||
#ifdef ETC_ETHERS
|
||||
#include <net/ethernet.h>
|
||||
extern int ether_hostton();
|
||||
#endif
|
||||
|
||||
#include <netdb.h>
|
||||
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 @@ int bsd_arp_set(ia, eaddr, len)
|
|||
}
|
||||
|
||||
|
||||
static int rtmsg(cmd)
|
||||
int cmd;
|
||||
static int
|
||||
rtmsg(int cmd)
|
||||
{
|
||||
static int seq;
|
||||
int rlen;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
u_char tag;
|
||||
u_char *ep;
|
||||
|
@ -376,9 +371,7 @@ rfc1048_print(bp, length)
|
|||
}
|
||||
|
||||
static void
|
||||
cmu_print(bp, length)
|
||||
u_char *bp;
|
||||
int length;
|
||||
cmu_print(u_char *bp, int length)
|
||||
{
|
||||
struct cmu_vend *v;
|
||||
|
||||
|
@ -424,9 +417,7 @@ cmu_print(bp, length)
|
|||
*/
|
||||
|
||||
static void
|
||||
other_print(bp, length)
|
||||
u_char *bp;
|
||||
int length;
|
||||
other_print(u_char *bp, int length)
|
||||
{
|
||||
u_char *ep; /* end pointer */
|
||||
u_char *zp; /* points one past last non-zero byte */
|
||||
|
@ -464,9 +455,7 @@ other_print(bp, length)
|
|||
}
|
||||
|
||||
static void
|
||||
dump_hex(bp, len)
|
||||
u_char *bp;
|
||||
int len;
|
||||
dump_hex(u_char *bp, int len)
|
||||
{
|
||||
while (len > 0) {
|
||||
printf("%02X", *bp);
|
||||
|
|
Loading…
Reference in a new issue