Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/rarpd ANSIfy. Remove ifndef __STDC__. Remove __P()....
details: https://anonhg.NetBSD.org/src/rev/5033f570d53a
branches: trunk
changeset: 534041:5033f570d53a
user: wiz <wiz%NetBSD.org@localhost>
date: Sun Jul 14 00:58:30 2002 +0000
description:
ANSIfy. Remove ifndef __STDC__. Remove __P(). Remove register.
diffstat:
usr.sbin/rarpd/mkarp.c | 20 ++----
usr.sbin/rarpd/mkarp.h | 4 +-
usr.sbin/rarpd/rarpd.c | 139 ++++++++++++++----------------------------------
3 files changed, 50 insertions(+), 113 deletions(-)
diffs (truncated from 399 to 300 lines):
diff -r 2158af3e7da4 -r 5033f570d53a usr.sbin/rarpd/mkarp.c
--- a/usr.sbin/rarpd/mkarp.c Sun Jul 14 00:56:22 2002 +0000
+++ b/usr.sbin/rarpd/mkarp.c Sun Jul 14 00:58:30 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mkarp.c,v 1.3 2000/02/11 11:27:20 abs Exp $ */
+/* $NetBSD: mkarp.c,v 1.4 2002/07/14 00:58:30 wiz Exp $ */
/*
* Copyright (c) 1984, 1993
@@ -46,7 +46,7 @@
#if 0
static char sccsid[] = "@(#)arp.c 8.3 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: mkarp.c,v 1.3 2000/02/11 11:27:20 abs Exp $");
+__RCSID("$NetBSD: mkarp.c,v 1.4 2002/07/14 00:58:30 wiz Exp $");
#endif
#endif /* not lint */
@@ -80,8 +80,8 @@
#include "mkarp.h"
-int rtmsg __P((int, int, struct rt_msghdr *, struct sockaddr_inarp *,
- struct sockaddr_dl *));
+int rtmsg(int, int, struct rt_msghdr *, struct sockaddr_inarp *,
+ struct sockaddr_dl *);
struct {
struct rt_msghdr m_rtm;
char m_space[512];
@@ -91,9 +91,7 @@
* Set an individual arp entry
*/
int
-mkarp(haddr, ipaddr)
- u_char *haddr;
- u_int32_t ipaddr;
+mkarp(u_char *haddr, u_int32_t ipaddr)
{
static struct sockaddr_inarp blank_sin = {sizeof(blank_sin), AF_INET };
static struct sockaddr_dl blank_sdl = {sizeof(blank_sdl), AF_LINK };
@@ -177,12 +175,8 @@
}
int
-rtmsg(cmd, s, rtm, sin_m, sdl_m)
- int cmd;
- int s;
- struct rt_msghdr *rtm;
- struct sockaddr_inarp *sin_m;
- struct sockaddr_dl *sdl_m;
+rtmsg(int cmd, int s, struct rt_msghdr *rtm, struct sockaddr_inarp *sin_m,
+ struct sockaddr_dl *sdl_m)
{
static int seq;
int rlen;
diff -r 2158af3e7da4 -r 5033f570d53a usr.sbin/rarpd/mkarp.h
--- a/usr.sbin/rarpd/mkarp.h Sun Jul 14 00:56:22 2002 +0000
+++ b/usr.sbin/rarpd/mkarp.h Sun Jul 14 00:58:30 2002 +0000
@@ -1,7 +1,7 @@
-/* $NetBSD: mkarp.h,v 1.1 1997/11/24 18:43:12 is Exp $ */
+/* $NetBSD: mkarp.h,v 1.2 2002/07/14 00:58:30 wiz Exp $ */
/*
* This file is in the public domain.
*/
-int mkarp __P((u_int8_t *, u_int32_t));
+int mkarp(u_int8_t *, u_int32_t);
diff -r 2158af3e7da4 -r 5033f570d53a usr.sbin/rarpd/rarpd.c
--- a/usr.sbin/rarpd/rarpd.c Sun Jul 14 00:56:22 2002 +0000
+++ b/usr.sbin/rarpd/rarpd.c Sun Jul 14 00:58:30 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rarpd.c,v 1.44 2002/01/11 05:33:22 itojun Exp $ */
+/* $NetBSD: rarpd.c,v 1.45 2002/07/14 00:58:30 wiz Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
@@ -28,7 +28,7 @@
#endif /* not lint */
#ifndef lint
-__RCSID("$NetBSD: rarpd.c,v 1.44 2002/01/11 05:33:22 itojun Exp $");
+__RCSID("$NetBSD: rarpd.c,v 1.45 2002/07/14 00:58:30 wiz Exp $");
#endif
@@ -95,36 +95,36 @@
*/
struct if_info *iflist;
-u_int32_t choose_ipaddr __P((u_int32_t **, u_int32_t, u_int32_t));
-void debug __P((const char *,...))
+u_int32_t choose_ipaddr(u_int32_t **, u_int32_t, u_int32_t);
+void debug(const char *,...)
__attribute__((__format__(__printf__, 1, 2)));
-void init_all __P((void));
-void init_one __P((char *, u_int32_t));
-u_int32_t ipaddrtonetmask __P((u_int32_t));
-void lookup_eaddr __P((char *, u_char *));
-void lookup_ipaddr __P((char *, u_int32_t *, u_int32_t *));
-int main __P((int, char **));
-void rarp_loop __P((void));
-int rarp_open __P((char *));
-void rarp_process __P((struct if_info *, u_char *));
-void rarp_reply __P((struct if_info *, struct ether_header *, u_int32_t,
- struct hostent *));
-void rarperr __P((int, const char *,...))
+void init_all(void);
+void init_one(char *, u_int32_t);
+u_int32_t ipaddrtonetmask(u_int32_t);
+void lookup_eaddr(char *, u_char *);
+void lookup_ipaddr(char *, u_int32_t *, u_int32_t *);
+int main(int, char **);
+void rarp_loop(void);
+int rarp_open(char *);
+void rarp_process(struct if_info *, u_char *);
+void rarp_reply(struct if_info *, struct ether_header *, u_int32_t,
+ struct hostent *);
+void rarperr(int, const char *,...)
__attribute__((__format__(__printf__, 2, 3)));
#if defined(__NetBSD__)
#include "mkarp.h"
#else
-void update_arptab __P((u_char *, u_int32_t));
+void update_arptab(u_char *, u_int32_t);
#endif
-void usage __P((void));
+void usage(void);
-static int bpf_open __P((void));
-static int rarp_check __P((u_char *, int));
+static int bpf_open(void);
+static int rarp_check(u_char *, int);
#ifdef REQUIRE_TFTPBOOT
-int rarp_bootable __P((u_int32_t));
+int rarp_bootable(u_int32_t);
#endif
int aflag = 0; /* listen on "all" interfaces */
@@ -133,9 +133,7 @@
int lflag = 0; /* log all replies */
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char **argv)
{
int op;
char *ifname, *hostname;
@@ -193,9 +191,7 @@
* mask and Ethernet address, and open a BPF file for it.
*/
void
-init_one(ifname, ipaddr)
- char *ifname;
- u_int32_t ipaddr;
+init_one(char *ifname, u_int32_t ipaddr)
{
struct if_info *h;
struct if_info *p;
@@ -243,7 +239,7 @@
* point to point.
*/
void
-init_all()
+init_all(void)
{
#ifdef HAVE_IFADDRS_H
struct ifaddrs *ifap, *ifa, *p;
@@ -318,7 +314,7 @@
}
void
-usage()
+usage(void)
{
(void) fprintf(stderr, "usage: rarpd -a [-d|-f] [-l]\n");
(void) fprintf(stderr, " rarpd [-d|-f] [-l] interface\n");
@@ -326,7 +322,7 @@
}
static int
-bpf_open()
+bpf_open(void)
{
int fd;
int n = 0;
@@ -349,8 +345,7 @@
* Set immediate mode, and set a filter that accepts only RARP requests.
*/
int
-rarp_open(device)
- char *device;
+rarp_open(char *device)
{
int fd;
struct ifreq ifr;
@@ -417,9 +412,7 @@
* false on failure and log the reason.
*/
static int
-rarp_check(p, len)
- u_char *p;
- int len;
+rarp_check(u_char *p, int len)
{
struct ether_header *ep = (struct ether_header *) p;
#ifdef __NetBSD__
@@ -484,7 +477,7 @@
* interfaces in 'iflist'.
*/
void
-rarp_loop()
+rarp_loop(void)
{
u_char *buf, *bp, *ep;
int cc, fd;
@@ -548,7 +541,7 @@
bp = buf;
ep = bp + cc;
while (bp < ep) {
- register int caplen, hdrlen;
+ int caplen, hdrlen;
caplen = bhp->bh_caplen;
hdrlen = bhp->bh_hdrlen;
@@ -574,11 +567,10 @@
* configuration file.
*/
int
-rarp_bootable(addr)
- u_int32_t addr;
+rarp_bootable(u_int32_t addr)
{
- register struct dirent *dent;
- register DIR *d;
+ struct dirent *dent;
+ DIR *d;
char ipname[9];
static DIR *dd = 0;
@@ -611,10 +603,7 @@
* of the address.
*/
u_int32_t
-choose_ipaddr(alist, net, netmask)
- u_int32_t **alist;
- u_int32_t net;
- u_int32_t netmask;
+choose_ipaddr(u_int32_t **alist, u_int32_t net, u_int32_t netmask)
{
for (; *alist; ++alist) {
@@ -628,9 +617,7 @@
* already been checked for validity. The reply is overlaid on the request.
*/
void
-rarp_process(ii, pkt)
- struct if_info *ii;
- u_char *pkt;
+rarp_process(struct if_info *ii, u_char *pkt)
{
struct ether_header *ep;
struct hostent *hp;
@@ -687,9 +674,7 @@
* file descriptor 'fd'; return it in 'eaddr'.
*/
void
-lookup_eaddr(ifname, eaddr)
- char *ifname;
- u_char *eaddr;
+lookup_eaddr(char *ifname, u_char *eaddr)
{
#ifdef HAVE_IFADDRS_H
struct ifaddrs *ifap, *ifa;
@@ -765,10 +750,7 @@
* Lookup the IP address and network mask of the interface named 'ifname'.
*/
void
-lookup_ipaddr(ifname, addrp, netmaskp)
- char *ifname;
- u_int32_t *addrp;
- u_int32_t *netmaskp;
+lookup_ipaddr(char *ifname, u_int32_t *addrp, u_int32_t *netmaskp)
{
int fd;
@@ -819,9 +801,7 @@
*/
#ifndef __NetBSD__
void
-update_arptab(ep, ipaddr)
- u_char *ep;
- u_int32_t ipaddr;
+update_arptab(u_char *ep, u_int32_t ipaddr)
{
Home |
Main Index |
Thread Index |
Old Index