summaryrefslogtreecommitdiffstats
path: root/libexec/rbootd
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-02-07 23:57:01 +0000
committerimp <imp@FreeBSD.org>2002-02-07 23:57:01 +0000
commitc963f1d00273d3cea8a89288017919b46b7374e3 (patch)
treeec514bcba5b68b3cc1a0c1e6821e5f92d0c6bf2d /libexec/rbootd
parent4289b50433ef09f1bfa03246de59392ffe6bb601 (diff)
downloadFreeBSD-src-c963f1d00273d3cea8a89288017919b46b7374e3.zip
FreeBSD-src-c963f1d00273d3cea8a89288017919b46b7374e3.tar.gz
o __P removal
o register removal o use new style prototypes and function definitions
Diffstat (limited to 'libexec/rbootd')
-rw-r--r--libexec/rbootd/bpf.c14
-rw-r--r--libexec/rbootd/defs.h66
-rw-r--r--libexec/rbootd/parseconf.c7
-rw-r--r--libexec/rbootd/rbootd.c25
-rw-r--r--libexec/rbootd/rmpproto.c26
-rw-r--r--libexec/rbootd/utils.c36
6 files changed, 69 insertions, 105 deletions
diff --git a/libexec/rbootd/bpf.c b/libexec/rbootd/bpf.c
index 98d6e00..ddd9cfb 100644
--- a/libexec/rbootd/bpf.c
+++ b/libexec/rbootd/bpf.c
@@ -88,7 +88,7 @@ static u_int8_t *BpfPkt = NULL;
** If an error is encountered, the program terminates here.
*/
int
-BpfOpen()
+BpfOpen(void)
{
struct ifreq ifr;
char bpfdev[32];
@@ -217,8 +217,7 @@ BpfOpen()
** None.
*/
char *
-BpfGetIntfName(errmsg)
- char **errmsg;
+BpfGetIntfName(char **errmsg)
{
struct ifreq ibuf[8], *ifrp, *ifend, *mp;
struct ifconf ifc;
@@ -307,9 +306,7 @@ BpfGetIntfName(errmsg)
** None.
*/
int
-BpfRead(rconn, doread)
- RMPCONN *rconn;
- int doread;
+BpfRead(RMPCONN *rconn, int doread)
{
int datlen, caplen, hdrlen;
static u_int8_t *bp = NULL, *ep = NULL;
@@ -373,8 +370,7 @@ BpfRead(rconn, doread)
** None.
*/
int
-BpfWrite(rconn)
- RMPCONN *rconn;
+BpfWrite(RMPCONN *rconn)
{
if (write(BpfFd, (char *)&rconn->rmp, rconn->rmplen) < 0) {
syslog(LOG_ERR, "write: %s: %m", EnetStr(rconn));
@@ -397,7 +393,7 @@ BpfWrite(rconn)
** None.
*/
void
-BpfClose()
+BpfClose(void)
{
struct ifreq ifr;
diff --git a/libexec/rbootd/defs.h b/libexec/rbootd/defs.h
index f62c83f..ff640c1 100644
--- a/libexec/rbootd/defs.h
+++ b/libexec/rbootd/defs.h
@@ -151,36 +151,36 @@ extern RMPCONN *RmpConns; /* list of active connections */
extern u_int8_t RmpMcastAddr[]; /* RMP multicast address */
-void AddConn __P((RMPCONN *));
-int BootDone __P((RMPCONN *));
-void BpfClose __P((void));
-char *BpfGetIntfName __P((char **));
-int BpfOpen __P((void));
-int BpfRead __P((RMPCONN *, int));
-int BpfWrite __P((RMPCONN *));
-void DebugOff __P((int));
-void DebugOn __P((int));
-void DispPkt __P((RMPCONN *, int));
-void DoTimeout __P((void));
-void DspFlnm __P((u_int, char *));
-void Exit __P((int));
-CLIENT *FindClient __P((RMPCONN *));
-RMPCONN *FindConn __P((RMPCONN *));
-void FreeClients __P((void));
-void FreeConn __P((RMPCONN *));
-void FreeConns __P((void));
-int GetBootFiles __P((void));
-char *GetEtherAddr __P((u_int8_t *));
-CLIENT *NewClient __P((u_int8_t *));
-RMPCONN *NewConn __P((RMPCONN *));
-char *NewStr __P((char *));
-u_int8_t *ParseAddr __P((char *));
-int ParseConfig __P((void));
-void ProcessPacket __P((RMPCONN *, CLIENT *));
-void ReConfig __P((int));
-void RemoveConn __P((RMPCONN *));
-int SendBootRepl __P((struct rmp_packet *, RMPCONN *, char *[]));
-int SendFileNo __P((struct rmp_packet *, RMPCONN *, char *[]));
-int SendPacket __P((RMPCONN *));
-int SendReadRepl __P((RMPCONN *));
-int SendServerID __P((RMPCONN *));
+void AddConn(RMPCONN *);
+int BootDone(RMPCONN *);
+void BpfClose(void);
+char *BpfGetIntfName(char **);
+int BpfOpen(void);
+int BpfRead(RMPCONN *, int);
+int BpfWrite(RMPCONN *);
+void DebugOff(int);
+void DebugOn(int);
+void DispPkt(RMPCONN *, int);
+void DoTimeout(void);
+void DspFlnm(u_int, char *);
+void Exit(int);
+CLIENT *FindClient(RMPCONN *);
+RMPCONN *FindConn(RMPCONN *);
+void FreeClients(void);
+void FreeConn(RMPCONN *);
+void FreeConns(void);
+int GetBootFiles(void);
+char *GetEtherAddr(u_int8_t *);
+CLIENT *NewClient(u_int8_t *);
+RMPCONN *NewConn(RMPCONN *);
+char *NewStr(char *);
+u_int8_t *ParseAddr(char *);
+int ParseConfig(void);
+void ProcessPacket(RMPCONN *, CLIENT *);
+void ReConfig(int);
+void RemoveConn(RMPCONN *);
+int SendBootRepl(struct rmp_packet *, RMPCONN *, char *[]);
+int SendFileNo(struct rmp_packet *, RMPCONN *, char *[]);
+int SendPacket(RMPCONN *);
+int SendReadRepl(RMPCONN *);
+int SendServerID(RMPCONN *);
diff --git a/libexec/rbootd/parseconf.c b/libexec/rbootd/parseconf.c
index bd2f2e1..2eb33e0 100644
--- a/libexec/rbootd/parseconf.c
+++ b/libexec/rbootd/parseconf.c
@@ -83,7 +83,7 @@ static const char rcsid[] =
** to create a linked list of default boot files.
*/
int
-ParseConfig()
+ParseConfig(void)
{
FILE *fp;
CLIENT *client;
@@ -248,8 +248,7 @@ ParseConfig()
** be copied if it's to be saved.
*/
u_int8_t *
-ParseAddr(str)
- char *str;
+ParseAddr(char *str)
{
static u_int8_t addr[RMP_ADDRLEN];
char *cp;
@@ -312,7 +311,7 @@ ParseAddr(str)
** called to re-order it's list of boot file pointers.
*/
int
-GetBootFiles()
+GetBootFiles(void)
{
DIR *dfd;
struct stat statb;
diff --git a/libexec/rbootd/rbootd.c b/libexec/rbootd/rbootd.c
index 70bd791..78a4fd6 100644
--- a/libexec/rbootd/rbootd.c
+++ b/libexec/rbootd/rbootd.c
@@ -72,12 +72,10 @@ static const char rcsid[] =
#include <unistd.h>
#include "defs.h"
-static void usage __P((void));
+static void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int c, fd, omask, maxfds;
fd_set rset;
@@ -289,7 +287,7 @@ main(argc, argv)
}
static void
-usage()
+usage(void)
{
fprintf(stderr, "usage: rbootd [-ad] [-i interface] [config_file]\n");
exit (1);
@@ -308,7 +306,7 @@ usage()
** - Timed out connections in `RmpConns' will be freed.
*/
void
-DoTimeout()
+DoTimeout(void)
{
RMPCONN *rtmp;
struct timeval now;
@@ -345,8 +343,7 @@ DoTimeout()
*/
CLIENT *
-FindClient(rconn)
- RMPCONN *rconn;
+FindClient(RMPCONN *rconn)
{
CLIENT *ctmp;
@@ -371,8 +368,7 @@ FindClient(rconn)
** - This process ceases to exist.
*/
void
-Exit(sig)
- int sig;
+Exit(int sig)
{
if (sig > 0)
syslog(LOG_ERR, "going down on signal %d", sig);
@@ -400,8 +396,7 @@ Exit(sig)
** - This routine must be called with SIGHUP blocked.
*/
void
-ReConfig(signo)
- int signo;
+ReConfig(int signo)
{
syslog(LOG_NOTICE, "reconfiguring boot server");
@@ -427,8 +422,7 @@ ReConfig(signo)
** - Debug file is closed.
*/
void
-DebugOff(signo)
- int signo;
+DebugOff(int signo)
{
if (DbgFp != NULL)
(void) fclose(DbgFp);
@@ -450,8 +444,7 @@ DebugOff(signo)
** otherwise do nothing.
*/
void
-DebugOn(signo)
- int signo;
+DebugOn(int signo)
{
if (DbgFp == NULL) {
if ((DbgFp = fopen(DbgFile, "w")) == NULL)
diff --git a/libexec/rbootd/rmpproto.c b/libexec/rbootd/rmpproto.c
index 3619b39..17ea202 100644
--- a/libexec/rbootd/rmpproto.c
+++ b/libexec/rbootd/rmpproto.c
@@ -86,9 +86,7 @@ static const char rcsid[] =
** sent to the host that sent the packet.
*/
void
-ProcessPacket(rconn, client)
- RMPCONN *rconn;
- CLIENT *client;
+ProcessPacket(RMPCONN *rconn, CLIENT *client)
{
struct rmp_packet *rmp;
RMPCONN *rconnout;
@@ -176,8 +174,7 @@ ProcessPacket(rconn, client)
** none.
*/
int
-SendServerID(rconn)
- RMPCONN *rconn;
+SendServerID(RMPCONN *rconn)
{
struct rmp_packet *rpl;
char *src, *dst;
@@ -228,10 +225,7 @@ SendServerID(rconn)
** none.
*/
int
-SendFileNo(req, rconn, filelist)
- struct rmp_packet *req;
- RMPCONN *rconn;
- char *filelist[];
+SendFileNo(struct rmp_packet *req, RMPCONN *rconn, char *filelist[])
{
struct rmp_packet *rpl;
char *src, *dst;
@@ -291,10 +285,7 @@ SendFileNo(req, rconn, filelist)
** none.
*/
int
-SendBootRepl(req, rconn, filelist)
- struct rmp_packet *req;
- RMPCONN *rconn;
- char *filelist[];
+SendBootRepl(struct rmp_packet *req, RMPCONN *rconn, char *filelist[])
{
int retval;
char *filename, filepath[RMPBOOTDATA+1];
@@ -400,8 +391,7 @@ sendpkt:
** none.
*/
int
-SendReadRepl(rconn)
- RMPCONN *rconn;
+SendReadRepl(RMPCONN *rconn)
{
int retval = 0;
RMPCONN *oldconn;
@@ -518,8 +508,7 @@ sendpkt:
** none.
*/
int
-BootDone(rconn)
- RMPCONN *rconn;
+BootDone(RMPCONN *rconn)
{
RMPCONN *oldconn;
struct rmp_packet *rpl;
@@ -566,8 +555,7 @@ BootDone(rconn)
** none.
*/
int
-SendPacket(rconn)
- RMPCONN *rconn;
+SendPacket(RMPCONN *rconn)
{
/*
* Set Ethernet Destination address to Source (BPF and the enet
diff --git a/libexec/rbootd/utils.c b/libexec/rbootd/utils.c
index 8aec599..c967bc7 100644
--- a/libexec/rbootd/utils.c
+++ b/libexec/rbootd/utils.c
@@ -79,9 +79,7 @@ static const char rcsid[] =
** None.
*/
void
-DispPkt(rconn, direct)
- RMPCONN *rconn;
- int direct;
+DispPkt(RMPCONN *rconn, int direct)
{
static const char BootFmt[] = "\t\tRetCode:%u SeqNo:%lx SessID:%x Vers:%u";
static const char ReadFmt[] = "\t\tRetCode:%u Offset:%lx SessID:%x\n";
@@ -208,8 +206,7 @@ DispPkt(rconn, direct)
** be copied if it's to be saved.
*/
char *
-GetEtherAddr(addr)
- u_int8_t *addr;
+GetEtherAddr(u_int8_t *addr)
{
static char Hex[] = "0123456789abcdef";
static char etherstr[RMP_ADDRLEN*3];
@@ -249,9 +246,7 @@ GetEtherAddr(addr)
** - Characters are sent to `DbgFp'.
*/
void
-DspFlnm(size, flnm)
- u_int size;
- char *flnm;
+DspFlnm(u_int size, char *flnm)
{
int i;
@@ -276,8 +271,7 @@ DspFlnm(size, flnm)
** - If malloc() fails, a log message will be generated.
*/
CLIENT *
-NewClient(addr)
- u_int8_t *addr;
+NewClient(u_int8_t *addr)
{
CLIENT *ctmp;
@@ -309,7 +303,7 @@ NewClient(addr)
** - This routine must be called with SIGHUP blocked.
*/
void
-FreeClients()
+FreeClients(void)
{
CLIENT *ctmp;
@@ -334,8 +328,7 @@ FreeClients()
** - If malloc() fails, a log message will be generated.
*/
char *
-NewStr(str)
- char *str;
+NewStr(char *str)
{
char *stmp;
@@ -369,8 +362,7 @@ static RMPCONN *LastFree = NULL;
** - If malloc() fails, a log message will be generated.
*/
RMPCONN *
-NewConn(rconn)
- RMPCONN *rconn;
+NewConn(RMPCONN *rconn)
{
RMPCONN *rtmp;
@@ -410,8 +402,7 @@ NewConn(rconn)
** - File desc associated with `rtmp->bootfd' will be closed.
*/
void
-FreeConn(rtmp)
- RMPCONN *rtmp;
+FreeConn(RMPCONN *rtmp)
{
/*
* If the file descriptor is in use, close the file.
@@ -445,7 +436,7 @@ FreeConn(rtmp)
** - This routine must be called with SIGHUP blocked.
*/
void
-FreeConns()
+FreeConns(void)
{
RMPCONN *rtmp;
@@ -477,8 +468,7 @@ FreeConns()
** - This routine must be called with SIGHUP blocked.
*/
void
-AddConn(rconn)
- RMPCONN *rconn;
+AddConn(RMPCONN *rconn)
{
if (RmpConns != NULL)
rconn->next = RmpConns;
@@ -505,8 +495,7 @@ AddConn(rconn)
** - This routine must be called with SIGHUP blocked.
*/
RMPCONN *
-FindConn(rconn)
- RMPCONN *rconn;
+FindConn(RMPCONN *rconn)
{
RMPCONN *rtmp;
@@ -535,8 +524,7 @@ FindConn(rconn)
** - This routine must be called with SIGHUP blocked.
*/
void
-RemoveConn(rconn)
- RMPCONN *rconn;
+RemoveConn(RMPCONN *rconn)
{
RMPCONN *thisrconn, *lastrconn;
OpenPOWER on IntegriCloud