- WARNsify

- KNFify (a bit)
- use int32_t & u_int32_t instead of long and u_long
- clean up man pages a bit
This commit is contained in:
lukem
1997-10-16 23:24:50 +00:00
parent 770ac80056
commit 334438cb6a
22 changed files with 293 additions and 424 deletions

View File

@@ -1,4 +1,4 @@
/* $NetBSD: nma.h,v 1.2 1997/03/25 03:07:23 thorpej Exp $ */
/* $NetBSD: nma.h,v 1.3 1997/10/16 23:24:50 lukem Exp $ */
/*
* Copyright (c) 1995 Mats O Jansson. All rights reserved.
@@ -28,21 +28,16 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $NetBSD: nma.h,v 1.2 1997/03/25 03:07:23 thorpej Exp $
* $NetBSD: nma.h,v 1.3 1997/10/16 23:24:50 lukem Exp $
*
*/
#ifndef _NMA_H_
#define _NMA_H_
#ifdef NO__P
char *nmaGetShort (/* int */);
char *nmaGetDevice (/* int */);
#else
__BEGIN_DECLS
char *nmaGetShort __P((int));
char *nmaGetDevice __P((int));
__END_DECLS
#endif
#endif _NMA_H_

View File

@@ -1,4 +1,4 @@
/* $NetBSD: os.h,v 1.2 1997/03/25 03:07:26 thorpej Exp $ */
/* $NetBSD: os.h,v 1.3 1997/10/16 23:24:53 lukem Exp $ */
/*
* Copyright (c) 1994-95 Mats O Jansson. All rights reserved.
@@ -28,30 +28,32 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $NetBSD: os.h,v 1.2 1997/03/25 03:07:26 thorpej Exp $
* $NetBSD: os.h,v 1.3 1997/10/16 23:24:53 lukem Exp $
*
*/
#ifndef _OS_H_
#define _OS_H_
#include <stdio.h>
#include <syslog.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_types.h>
#include <sys/ioctl.h>
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <strings.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
#include <time.h>
#include <unistd.h>
#define DEV_NEW_CONF

View File

@@ -1,4 +1,4 @@
/* $NetBSD: pf.c,v 1.3 1997/03/25 03:07:27 thorpej Exp $ */
/* $NetBSD: pf.c,v 1.4 1997/10/16 23:24:55 lukem Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -33,40 +33,23 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LINT
static char rcsid[] = "$NetBSD: pf.c,v 1.3 1997/03/25 03:07:27 thorpej Exp $";
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: pf.c,v 1.4 1997/10/16 23:24:55 lukem Exp $");
#endif
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <sys/file.h>
#include <sys/socket.h>
#include "os.h"
#include <sys/uio.h>
#include <net/if.h>
#include <net/bpf.h>
#include <sys/errno.h>
#include <netinet/in.h>
#include <netinet/if_inarp.h>
#include <netdb.h>
#include <ctype.h>
#include <strings.h>
#include <syslog.h>
#include <varargs.h>
#include "common/mopdef.h"
#include "mopdef.h"
#include "pf.h"
/*
* Variables
*/
extern int errno;
extern int promisc;
/*
@@ -179,7 +162,7 @@ pfAddMulti(s, interface, addr)
strcpy(ifr.ifr_name, interface);
ifr.ifr_addr.sa_family = AF_UNSPEC;
bcopy(addr, ifr.ifr_addr.sa_data, 6);
memmove(ifr.ifr_addr.sa_data, addr, 6);
/*
* open a socket, temporarily, to use for SIOC* ioctls
@@ -214,7 +197,7 @@ pfDelMulti(s, interface, addr)
strcpy(ifr.ifr_name, interface);
ifr.ifr_addr.sa_family = AF_UNSPEC;
bcopy(addr, ifr.ifr_addr.sa_data, 6);
memmove(ifr.ifr_addr.sa_data, addr, 6);
/*
* open a socket, temporarily, to use for SIOC* ioctls

View File

@@ -1,4 +1,4 @@
/* $NetBSD: pf.h,v 1.2 1997/03/25 03:07:29 thorpej Exp $ */
/* $NetBSD: pf.h,v 1.3 1997/10/16 23:24:56 lukem Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -28,22 +28,13 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $NetBSD: pf.h,v 1.2 1997/03/25 03:07:29 thorpej Exp $
* $NetBSD: pf.h,v 1.3 1997/10/16 23:24:56 lukem Exp $
*
*/
#ifndef _PF_H_
#define _PF_H_
#ifdef NO__P
int pfTrans (/* char * */);
int pfInit (/* char *, int, u_short, int */);
int pfEthAddr (/* int, u_char * */);
int pfAddMulti (/* int, char *, char * */);
int pfDelMulti (/* int, char *, char * */);
int pfRead (/* int, u_char *, int */);
int pfWrite (/* int, u_char *, int, int */);
#else
__BEGIN_DECLS
int pfTrans __P((char *));
int pfInit __P((char *, int, u_short, int));
@@ -53,6 +44,5 @@ int pfDelMulti __P((int, char *, char *));
int pfRead __P((int, u_char *, int));
int pfWrite __P((int, u_char *, int, int));
__END_DECLS
#endif
#endif _PF_H_

View File

@@ -1,4 +1,4 @@
/* $NetBSD: print.c,v 1.2 1997/03/25 03:07:30 thorpej Exp $ */
/* $NetBSD: print.c,v 1.3 1997/10/16 23:24:58 lukem Exp $ */
/*
* Copyright (c) 1993-96 Mats O Jansson. All rights reserved.
@@ -29,19 +29,21 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LINT
static char rcsid[] = "$NetBSD: print.c,v 1.2 1997/03/25 03:07:30 thorpej Exp $";
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: print.c,v 1.3 1997/10/16 23:24:58 lukem Exp $");
#endif
#include <sys/types.h>
#include <stdio.h>
#include "os.h"
#include "common/mopdef.h"
#include "common/nmadef.h"
#include "common/nma.h"
#include "common/cmp.h"
#include "common/get.h"
#include "cmp.h"
#include "get.h"
#include "mopdef.h"
#include "nma.h"
#include "nmadef.h"
#include "print.h"
#define SHORT_PRINT

View File

@@ -1,4 +1,4 @@
/* $NetBSD: print.h,v 1.2 1997/03/25 03:07:31 thorpej Exp $ */
/* $NetBSD: print.h,v 1.3 1997/10/16 23:25:00 lukem Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -28,25 +28,13 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $NetBSD: print.h,v 1.2 1997/03/25 03:07:31 thorpej Exp $
* $NetBSD: print.h,v 1.3 1997/10/16 23:25:00 lukem Exp $
*
*/
#ifndef _PRINT_H_
#define _PRINT_H_
#ifdef NO__P
void mopPrintHWA (/* FILE *, u_char * */);
void mopPrintBPTY (/* FILE *, u_char */);
void mopPrintPGTY (/* FILE *, u_char */);
void mopPrintOneline (/* FILE *, u_char *, int */);
void mopPrintHeader (/* FILE *, u_char *, int */);
void mopPrintMopHeader (/* FILE *, u_char *, int */);
void mopPrintDevice (/* FILE *, u_char */);
void mopPrintTime (/* FILE *, u_char * */);
void mopPrintInfo (/* FILE *, u_char *, int *, u_short,
u_char, int */);
#else
__BEGIN_DECLS
void mopPrintHWA __P((FILE *, u_char *));
void mopPrintBPTY __P((FILE *, u_char));
@@ -59,6 +47,5 @@ void mopPrintTime __P((FILE *, u_char *));
void mopPrintInfo __P((FILE *, u_char *, int *, u_short,
u_char, int));
__END_DECLS
#endif
#endif _PRINT_H_

View File

@@ -1,4 +1,4 @@
/* $NetBSD: put.c,v 1.2 1997/03/25 03:07:33 thorpej Exp $ */
/* $NetBSD: put.c,v 1.3 1997/10/16 23:25:01 lukem Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -29,19 +29,19 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LINT
static char rcsid[] = "$NetBSD: put.c,v 1.2 1997/03/25 03:07:33 thorpej Exp $";
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: put.c,v 1.3 1997/10/16 23:25:01 lukem Exp $");
#endif
#include <stddef.h>
#include <sys/types.h>
#include <time.h>
#include "common/mopdef.h"
#include "os.h"
#include "mopdef.h"
#include "put.h"
void
mopPutChar(pkt, index, value)
register u_char *pkt;
register int *index;
u_char *pkt;
int *index;
u_char value;
{
pkt[*index] = value;
@@ -50,8 +50,8 @@ mopPutChar(pkt, index, value)
void
mopPutShort(pkt, index, value)
register u_char *pkt;
register int *index;
u_char *pkt;
int *index;
u_short value;
{
int i;
@@ -64,9 +64,9 @@ mopPutShort(pkt, index, value)
void
mopPutLong(pkt, index, value)
register u_char *pkt;
register int *index;
u_long value;
u_char *pkt;
int *index;
u_int32_t value;
{
int i;
for (i = 0; i < 4; i++) {
@@ -78,8 +78,8 @@ mopPutLong(pkt, index, value)
void
mopPutMulti(pkt, index, value, size)
register u_char *pkt,*value;
register int *index,size;
u_char *pkt,*value;
int *index,size;
{
int i;
@@ -91,9 +91,9 @@ mopPutMulti(pkt, index, value, size)
void
mopPutTime(pkt, index, value)
register u_char *pkt;
register int *index;
time_t value;
u_char *pkt;
int *index;
time_t value;
{
time_t tnow;
struct tm *timenow;
@@ -121,9 +121,9 @@ mopPutTime(pkt, index, value)
void
mopPutHeader(pkt, index, dst, src, proto, trans)
register u_char *pkt;
register int *index;
char dst[], src[];
u_char *pkt;
int *index;
u_char dst[], src[];
u_short proto;
int trans;
{
@@ -158,7 +158,7 @@ mopPutHeader(pkt, index, dst, src, proto, trans)
void
mopPutLength(pkt, trans, len)
register u_char *pkt;
u_char *pkt;
int trans;
u_short len;
{
@@ -183,6 +183,3 @@ mopPutLength(pkt, trans, len)
}
}

View File

@@ -1,4 +1,4 @@
/* $NetBSD: put.h,v 1.2 1997/03/25 03:07:34 thorpej Exp $ */
/* $NetBSD: put.h,v 1.3 1997/10/16 23:25:03 lukem Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -28,31 +28,21 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $NetBSD: put.h,v 1.2 1997/03/25 03:07:34 thorpej Exp $
* $NetBSD: put.h,v 1.3 1997/10/16 23:25:03 lukem Exp $
*
*/
#ifndef _PUT_H_
#define _PUT_H_
#ifdef NO__P
void mopPutChar (/* u_char *, int *, u_char */);
void mopPutShort (/* u_char *, int *, u_short */);
void mopPutLong (/* u_char *, int *, u_long */);
void mopPutMulti (/* u_char *, int *, u_char *, int */);
void mopPutTime (/* u_char *, int *, time_t */);
void mopPutHeader (/* u_char *, int *, u_char *, u_char *, u_short, int */);
void mopPutLength (/* u_char *, int, u_short */);
#else
__BEGIN_DECLS
void mopPutChar __P((u_char *, int *, u_char));
void mopPutShort __P((u_char *, int *, u_short));
void mopPutLong __P((u_char *, int *, u_long));
void mopPutMulti __P((u_char *, int *, u_char *, int));
void mopPutTime __P((u_char *, int *, time_t));
void mopPutChar __P((u_char *, int *, u_char));
void mopPutShort __P((u_char *, int *, u_short));
void mopPutLong __P((u_char *, int *, u_int32_t));
void mopPutMulti __P((u_char *, int *, u_char *, int));
void mopPutTime __P((u_char *, int *, time_t));
void mopPutHeader __P((u_char *, int *, u_char *, u_char *, u_short, int));
void mopPutLength __P((u_char *, int, u_short));
__END_DECLS
#endif
#endif _PUT_H_
#endif /* _PUT_H_ */

View File

@@ -1,4 +1,4 @@
/* $NetBSD: rc.c,v 1.2 1997/03/25 03:07:35 thorpej Exp $ */
/* $NetBSD: rc.c,v 1.3 1997/10/16 23:25:04 lukem Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -29,14 +29,16 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LINT
static char rcsid[] = "$NetBSD: rc.c,v 1.2 1997/03/25 03:07:35 thorpej Exp $";
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: rc.c,v 1.3 1997/10/16 23:25:04 lukem Exp $");
#endif
#include "os.h"
#include "common/get.h"
#include "common/print.h"
#include "common/mopdef.h"
#include "get.h"
#include "mopdef.h"
#include "print.h"
#include "rc.h"
void
mopDumpRC(fd, pkt, trans)
@@ -45,7 +47,7 @@ mopDumpRC(fd, pkt, trans)
int trans;
{
int i,index = 0;
long tmpl;
int32_t tmpl;
u_char tmpc,code,control;
u_short len,tmps,moplen;

View File

@@ -1,4 +1,4 @@
/* $NetBSD: rc.h,v 1.2 1997/03/25 03:07:36 thorpej Exp $ */
/* $NetBSD: rc.h,v 1.3 1997/10/16 23:25:05 lukem Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -28,19 +28,15 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $NetBSD: rc.h,v 1.2 1997/03/25 03:07:36 thorpej Exp $
* $NetBSD: rc.h,v 1.3 1997/10/16 23:25:05 lukem Exp $
*
*/
#ifndef _RC_H_
#define _RC_H_
#ifdef NO__P
void mopDumpRC (/* FILE *, u_char *, int */);
#else
__BEGIN_DECLS
void mopDumpRC __P((FILE *, u_char *, int));
__END_DECLS
#endif
#endif _RC_H_