+ kread is not a boolean, so check it as such
+ fix $FreeBSD$ Ids
+ denote copyrights with /*-
+ misc whitespace changes.
This commit is contained in:
David E. O'Brien 2008-01-02 23:26:11 +00:00
parent 24ecb0cb15
commit 65475bc8e6
18 changed files with 250 additions and 255 deletions

View File

@ -1,4 +1,4 @@
/*
/*-
* Copyright (c) 1983, 1988, 1993
* The Regents of the University of California. All rights reserved.
*

View File

@ -22,9 +22,11 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/protosw.h>
#include <sys/socket.h>

View File

@ -1,4 +1,4 @@
/*
/*-
* Copyright (c) 1983, 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@ -214,10 +214,10 @@ intpr(int interval1, u_long ifnetaddr, void (*pfunc)(char *))
sidewaysintpr(interval1, ifnetaddr);
return;
}
if (kread(ifnetaddr, (char *)&ifnethead, sizeof ifnethead))
if (kread(ifnetaddr, (char *)&ifnethead, sizeof ifnethead) != 0)
return;
ifnetaddr = (u_long)TAILQ_FIRST(&ifnethead);
if (kread(ifnetaddr, (char *)&ifnet, sizeof ifnet))
if (kread(ifnetaddr, (char *)&ifnet, sizeof ifnet) != 0)
return;
if (!pfunc) {
@ -253,11 +253,11 @@ intpr(int interval1, u_long ifnetaddr, void (*pfunc)(char *))
if (ifaddraddr == 0) {
ifnetfound = ifnetaddr;
if (kread(ifnetaddr, (char *)&ifnet, sizeof ifnet))
if (kread(ifnetaddr, (char *)&ifnet, sizeof ifnet) != 0)
return;
strlcpy(name, ifnet.if_xname, sizeof(name));
ifnetaddr = (u_long)TAILQ_NEXT(&ifnet, if_link);
if (interface != 0 && (strcmp(name, interface) != 0))
if (interface != 0 && strcmp(name, interface) != 0)
continue;
cp = index(name, '\0');
@ -298,7 +298,8 @@ intpr(int interval1, u_long ifnetaddr, void (*pfunc)(char *))
printf("%-13.13s ", "none");
printf("%-17.17s ", "none");
} else {
if (kread(ifaddraddr, (char *)&ifaddr, sizeof ifaddr)) {
if (kread(ifaddraddr, (char *)&ifaddr, sizeof ifaddr)
!= 0) {
ifaddraddr = 0;
continue;
}
@ -455,11 +456,11 @@ intpr(int interval1, u_long ifnetaddr, void (*pfunc)(char *))
TAILQ_FOREACH(multiaddr, &ifnet.if_multiaddrs, ifma_link) {
if (kread((u_long)multiaddr, (char *)&ifma,
sizeof ifma))
sizeof ifma) != 0)
break;
multiaddr = &ifma;
if (kread((u_long)ifma.ifma_addr, (char *)&msa,
sizeof msa))
sizeof msa) != 0)
break;
if (msa.sa.sa_family != sa->sa_family)
continue;
@ -541,7 +542,7 @@ sidewaysintpr(int interval1, u_long off)
int oldmask, first;
u_long interesting_off;
if (kread(off, (char *)&ifnethead, sizeof ifnethead))
if (kread(off, (char *)&ifnethead, sizeof ifnethead) != 0)
return;
firstifnet = (u_long)TAILQ_FIRST(&ifnethead);
@ -556,7 +557,7 @@ sidewaysintpr(int interval1, u_long off)
for (off = firstifnet, ip = iftot; off;) {
char name[IFNAMSIZ];
if (kread(off, (char *)&ifnet, sizeof ifnet))
if (kread(off, (char *)&ifnet, sizeof ifnet) != 0)
break;
strlcpy(name, ifnet.if_xname, sizeof(name));
if (interface && strcmp(name, interface) == 0) {
@ -607,7 +608,7 @@ sidewaysintpr(int interval1, u_long off)
loop:
if (interesting != NULL) {
ip = interesting;
if (kread(interesting_off, (char *)&ifnet, sizeof ifnet)) {
if (kread(interesting_off, (char *)&ifnet, sizeof ifnet) != 0) {
printf("???\n");
exit(1);
};
@ -644,7 +645,7 @@ sidewaysintpr(int interval1, u_long off)
for (off = firstifnet, ip = iftot;
off && SLIST_NEXT(ip, chain) != NULL;
ip = SLIST_NEXT(ip, chain)) {
if (kread(off, (char *)&ifnet, sizeof ifnet)) {
if (kread(off, (char *)&ifnet, sizeof ifnet) != 0) {
off = 0;
continue;
}

View File

@ -1,4 +1,4 @@
/*
/*-
* Copyright (c) 1983, 1988, 1993, 1995
* The Regents of the University of California. All rights reserved.
*
@ -85,8 +85,8 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#include "netstat.h"
char *inetname (struct in_addr *);
void inetprint (struct in_addr *, int, const char *, int);
char *inetname(struct in_addr *);
void inetprint(struct in_addr *, int, const char *, int);
#ifdef INET6
static int udp_done, tcp_done;
#endif /* INET6 */

View File

@ -1,5 +1,5 @@
/* BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp */
/*
/*-
* Copyright (c) 1983, 1988, 1993
* The Regents of the University of California. All rights reserved.
*

View File

@ -1,7 +1,6 @@
/* $FreeBSD$ */
/* $KAME: ipsec.c,v 1.33 2003/07/25 09:54:32 itojun Exp $ */
/*
/*-
* Copyright (c) 2005 NTT Multimedia Communications Laboratories, Inc.
* All rights reserved.
*
@ -26,8 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
/*-
* Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
* All rights reserved.
*
@ -55,8 +53,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
/*-
* Copyright (c) 1983, 1988, 1993
* The Regents of the University of California. All rights reserved.
*

View File

@ -1,4 +1,4 @@
/*
/*-
* Copyright (c) 2004, Robert N. M. Watson
* Copyright (c) 1983, 1988, 1993
* The Regents of the University of California. All rights reserved.
@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include "netstat.h"
static char *ipx_prpr (struct ipx_addr *);
static char *ipx_prpr(struct ipx_addr *);
/*
* Print a summary of connections related to a Network Systems

View File

@ -1,4 +1,4 @@
/*
/*-
* Copyright (c) 1983, 1988, 1993
* Regents of the University of California. All rights reserved.
*

View File

@ -1,4 +1,4 @@
/*
/*-
* Copyright (c) 1983, 1988, 1993
* The Regents of the University of California.
* Copyright (c) 2005 Robert N. M. Watson
@ -300,7 +300,7 @@ mbpr(void *kvmd, u_long mbaddr)
goto out;
}
} else {
if (kread(mbaddr, (char *)&mbstat, sizeof mbstat))
if (kread(mbaddr, (char *)&mbstat, sizeof mbstat) != 0)
goto out;
}
printf("%lu requests for sfbufs denied\n", mbstat.sf_allocfail);

View File

@ -1,4 +1,4 @@
/*
/*-
* Copyright (c) 2007 Bruce M. Simpson <bms@FreeBSD.org>
* All rights reserved.
*

View File

@ -1,4 +1,4 @@
/*
/*-
* Copyright (c) 1989 Stephen Deering
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.

View File

@ -1,4 +1,4 @@
/*
/*-
* Copyright (C) 1998 WIDE Project.
* All rights reserved.
*
@ -26,8 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
/*-
* Copyright (c) 1989 Stephen Deering
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.

View File

@ -1,4 +1,4 @@
/*
/*-
* Copyright (c) 1996-1999 Whistle Communications, Inc.
* All rights reserved.
*

View File

@ -1,4 +1,4 @@
/*
/*-
* Copyright (c) 1992, 1993
* Regents of the University of California. All rights reserved.
*
@ -78,13 +78,13 @@ void ip_stats(u_long, const char *, int, int);
void icmp_stats(u_long, const char *, int, int);
void igmp_stats(u_long, const char *, int, int);
void pim_stats(u_long, const char *, int, int);
void carp_stats (u_long, const char *, int, int);
void pfsync_stats (u_long, const char *, int, int);
void carp_stats(u_long, const char *, int, int);
void pfsync_stats(u_long, const char *, int, int);
#ifdef IPSEC
void ipsec_stats(u_long, const char *, int, int);
void esp_stats (u_long, const char *, int, int);
void ah_stats (u_long, const char *, int, int);
void ipcomp_stats (u_long, const char *, int, int);
void esp_stats(u_long, const char *, int, int);
void ah_stats(u_long, const char *, int, int);
void ipcomp_stats(u_long, const char *, int, int);
#endif
#ifdef INET6

View File

@ -1,8 +1,6 @@
/* $FreeBSD$ */
/* $NetBSD: inet.c,v 1.35.2.1 1999/04/29 14:57:08 perry Exp $ */
/* $KAME: ipsec.c,v 1.25 2001/03/12 09:04:39 itojun Exp $ */
/*
/*-
* Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
* All rights reserved.
*
@ -30,8 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
/*-
* Copyright (c) 1983, 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@ -64,14 +61,14 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if 0
#ifndef lint
/*
static char sccsid[] = "@(#)inet.c 8.5 (Berkeley) 5/24/95";
*/
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#endif
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/queue.h>

View File

@ -1,4 +1,4 @@
/*
/*-
* Copyright (c) 1983, 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@ -121,21 +121,21 @@ int NewTree = 0;
struct timespec uptime;
static struct sockaddr *kgetsa (struct sockaddr *);
static void size_cols (int ef, struct radix_node *rn);
static void size_cols_tree (struct radix_node *rn);
static void size_cols_rtentry (struct rtentry *rt);
static void p_tree (struct radix_node *);
static void p_rtnode (void);
static void ntreestuff (void);
static void np_rtentry (struct rt_msghdr *);
static void p_sockaddr (struct sockaddr *, struct sockaddr *, int, int);
static const char *fmt_sockaddr (struct sockaddr *sa, struct sockaddr *mask,
static struct sockaddr *kgetsa(struct sockaddr *);
static void size_cols(int ef, struct radix_node *rn);
static void size_cols_tree(struct radix_node *rn);
static void size_cols_rtentry(struct rtentry *rt);
static void p_tree(struct radix_node *);
static void p_rtnode(void);
static void ntreestuff(void);
static void np_rtentry(struct rt_msghdr *);
static void p_sockaddr(struct sockaddr *, struct sockaddr *, int, int);
static const char *fmt_sockaddr(struct sockaddr *sa, struct sockaddr *mask,
int flags);
static void p_flags (int, const char *);
static void p_flags(int, const char *);
static const char *fmt_flags(int f);
static void p_rtentry (struct rtentry *);
static void domask (char *, u_long, u_long);
static void p_rtentry(struct rtentry *);
static void domask(char *, u_long, u_long);
/*
* Print routing tables.

View File

@ -28,7 +28,6 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#if 0
#ifndef lint
static char sccsid[] = "@(#)sctp.c 0.1 (Berkeley) 4/18/2007";
@ -64,7 +63,7 @@ __FBSDID("$FreeBSD$");
#ifdef SCTP
void inetprint (struct in_addr *, int, const char *, int);
void inetprint(struct in_addr *, int, const char *, int);
static void sctp_statesprint(uint32_t state);
#define NETSTAT_SCTP_STATES_CLOSED 0x0

View File

@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$");
#include <kvm.h>
#include "netstat.h"
static void unixdomainpr (struct xunpcb *, struct xsocket *);
static void unixdomainpr(struct xunpcb *, struct xsocket *);
static const char *const socktype[] =
{ "#0", "stream", "dgram", "raw", "rdm", "seqpacket" };