Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/systat kill ipsec support which hasn't been working ...



details:   https://anonhg.NetBSD.org/src/rev/e080018e8c95
branches:  trunk
changeset: 772510:e080018e8c95
user:      drochner <drochner%NetBSD.org@localhost>
date:      Fri Jan 06 14:08:08 2012 +0000

description:
kill ipsec support which hasn't been working for a long time
(neither for KAME nor for FAST_IPSEC)

diffstat:

 usr.bin/systat/Makefile |    5 +-
 usr.bin/systat/cmdtab.c |   19 +--
 usr.bin/systat/extern.h |   15 +--
 usr.bin/systat/ipsec.c  |  300 ------------------------------------------------
 usr.bin/systat/systat.1 |    8 +-
 5 files changed, 6 insertions(+), 341 deletions(-)

diffs (truncated from 439 to 300 lines):

diff -r 8164de4033fd -r e080018e8c95 usr.bin/systat/Makefile
--- a/usr.bin/systat/Makefile   Fri Jan 06 14:04:02 2012 +0000
+++ b/usr.bin/systat/Makefile   Fri Jan 06 14:08:08 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.36 2010/02/06 23:45:26 he Exp $
+#      $NetBSD: Makefile,v 1.37 2012/01/06 14:08:08 drochner Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/6/93
 
 .include <bsd.own.mk>
@@ -22,9 +22,6 @@
 LINKS= ${BINDIR}/systat ${BINDIR}/sysstat
 MLINKS+=systat.1 sysstat.1
 
-CPPFLAGS+=-DIPSEC
-SRCS+= ipsec.c
-
 .if (${USE_INET6} != "no")
 CPPFLAGS+=-DINET6
 SRCS+= ip6.c
diff -r 8164de4033fd -r e080018e8c95 usr.bin/systat/cmdtab.c
--- a/usr.bin/systat/cmdtab.c   Fri Jan 06 14:04:02 2012 +0000
+++ b/usr.bin/systat/cmdtab.c   Fri Jan 06 14:08:08 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cmdtab.c,v 1.23 2007/02/18 17:00:08 dsl Exp $  */
+/*     $NetBSD: cmdtab.c,v 1.24 2012/01/06 14:08:08 drochner Exp $     */
 
 /*-
  * Copyright (c) 1980, 1992, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)cmdtab.c   8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: cmdtab.c,v 1.23 2007/02/18 17:00:08 dsl Exp $");
+__RCSID("$NetBSD: cmdtab.c,v 1.24 2012/01/06 14:08:08 drochner Exp $");
 #endif /* not lint */
 
 #include "systat.h"
@@ -100,16 +100,6 @@
 };
 #endif
 
-#ifdef IPSEC
-struct command ipsec_commands[] = {
-       { "boot",       ipsec_boot,     "show total stats since boot"},
-       { "run",        ipsec_run,      "show running total stats"},
-       { "time",       ipsec_time,     "show stats for each sample time"},
-       { "zero",       ipsec_zero,     "re-zero running totals"},
-       { .c_name = NULL }
-};
-#endif
-
 struct command netstat_commands[] = {
        { "all",        netstat_all,     "include server sockets"},
        { "display",    netstat_display, "show specified hosts or ports"},
@@ -186,11 +176,6 @@
          initip6,      openip6,        closeip6,       ip6_commands,
          CF_LOADAV },
 #endif
-#ifdef IPSEC
-       { "ipsec",      showipsec,      fetchipsec,     labelipsec,
-         initipsec,    openipsec,      closeipsec,     ipsec_commands,
-         CF_LOADAV },
-#endif
        { "iostat",     showiostat,     fetchiostat,    labeliostat,
          initiostat,   openiostat,     closeiostat,    iostat_commands,
          CF_LOADAV },
diff -r 8164de4033fd -r e080018e8c95 usr.bin/systat/extern.h
--- a/usr.bin/systat/extern.h   Fri Jan 06 14:04:02 2012 +0000
+++ b/usr.bin/systat/extern.h   Fri Jan 06 14:08:08 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: extern.h,v 1.41 2011/09/06 18:31:44 joerg Exp $        */
+/*     $NetBSD: extern.h,v 1.42 2012/01/06 14:08:08 drochner Exp $     */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -221,16 +221,3 @@
 void    ip6_time(char *);
 void    ip6_zero(char *);
 #endif
-
-#ifdef IPSEC
-void    closeipsec(WINDOW *);
-void    fetchipsec(void);
-int     initipsec(void);
-void    labelipsec(void);
-WINDOW *openipsec(void);
-void    showipsec(void);
-void    ipsec_boot(char *);
-void    ipsec_run(char *);
-void    ipsec_time(char *);
-void    ipsec_zero(char *);
-#endif
diff -r 8164de4033fd -r e080018e8c95 usr.bin/systat/ipsec.c
--- a/usr.bin/systat/ipsec.c    Fri Jan 06 14:04:02 2012 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,300 +0,0 @@
-/*     $NetBSD: ipsec.c,v 1.10 2008/04/23 06:09:04 thorpej Exp $       */
-
-/*
- * Copyright (c) 1999, 2000 Andrew Doran <ad%NetBSD.org@localhost>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * 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.
- *
- */
-
-#include <sys/cdefs.h>
-#ifndef lint
-__RCSID("$NetBSD: ipsec.c,v 1.10 2008/04/23 06:09:04 thorpej Exp $");
-#endif /* not lint */
-
-#include <sys/param.h>
-#include <sys/sysctl.h>
-
-#include <netinet/in.h>
-#include <netinet6/ipsec.h>
-
-#include <string.h>
-
-#include "systat.h"
-#include "extern.h"
-
-#define LHD(row, str)          mvwprintw(wnd, row, 10, str)
-#define RHD(row, str)          mvwprintw(wnd, row, 45, str);
-#define SHOW(stat, row, col) \
-    mvwprintw(wnd, row, col, "%9llu", (unsigned long long)curstat.stat)
-
-struct mystat {
-       uint64_t i4[IPSEC_NSTATS];
-#ifdef INET6
-       uint64_t i6[IPSEC_NSTATS];
-#endif
-};
-
-enum update {
-       UPDATE_TIME,
-       UPDATE_BOOT,
-       UPDATE_RUN,
-};
-
-static enum update update = UPDATE_TIME;
-static struct mystat curstat;
-static struct mystat newstat;
-static struct mystat oldstat;
-
-static struct nlist namelist[] = {
-       { .n_name = "_ipsecstat" },
-#ifdef INET6
-       { .n_name = "_ipsec6stat" },
-#endif
-       { .n_name = NULL }
-};
-
-WINDOW *
-openipsec(void)
-{
-
-       return (subwin(stdscr, -1, 0, 5, 0));
-}
-
-void
-closeipsec(WINDOW *w)
-{
-
-       if (w != NULL) {
-               wclear(w);
-               wrefresh(w);
-               delwin(w);
-       }
-}
-
-void
-labelipsec(void)
-{
-
-       wmove(wnd, 0, 0); wclrtoeol(wnd);
-
-       if (namelist[0].n_type) {
-               mvwprintw(wnd, 0, 0,  "------ IPv4 IPsec input ------");
-               LHD(1,  "processed successfully");
-               LHD(2,  "violated process policy");
-               LHD(3,  "with no SA available");
-               LHD(4,  "failed due to EINVAL");
-               LHD(5,  "failed getting SPI");
-               LHD(6,  "failed on AH replay check");
-               LHD(7,  "failed on ESP replay check");
-               LHD(8,  "considered authentic");
-               LHD(9,  "failed on authentication");
-
-               mvwprintw(wnd, 11, 0,  "------ IPv4 IPsec output ------");
-               LHD(12, "processed successfully");
-               LHD(13, "violated process policy");
-               LHD(14, "with no SA available");
-               LHD(15, "failed processing due to EINVAL");
-               LHD(16, "with no route");
-       }
-
-#ifdef INET6
-       if (namelist[1].n_type) {
-               mvwprintw(wnd, 0, 35,  "------ IPv6 IPsec input ------");
-               RHD(1,  "processed successfully");
-               RHD(2,  "violated process policy");
-               RHD(3,  "with no SA available");
-               RHD(4,  "failed due to EINVAL");
-               RHD(5,  "failed getting SPI");
-               RHD(6,  "failed on AH replay check");
-               RHD(7,  "failed on ESP replay check");
-               RHD(8,  "considered authentic");
-               RHD(9,  "failed on authentication");
-
-               mvwprintw(wnd, 11, 35,  "------ IPv6 IPsec output ------");
-               RHD(12, "processed successfully");
-               RHD(13, "violated process policy");
-               RHD(14, "with no SA available");
-               RHD(15, "failed due to EINVAL");
-               RHD(16, "with no route");
-       }
-#endif
-}
-       
-void
-showipsec(void)
-{
-
-       if (namelist[0].n_type) {
-               SHOW(i4[IPSEC_STAT_IN_SUCCESS],         1, 0);
-               SHOW(i4[IPSEC_STAT_IN_POLVIO],          2, 0);
-               SHOW(i4[IPSEC_STAT_IN_NOSA],            3, 0);
-               SHOW(i4[IPSEC_STAT_IN_INVAL],           4, 0);
-               SHOW(i4[IPSEC_STAT_IN_BADSPI],          5, 0);
-               SHOW(i4[IPSEC_STAT_IN_AHREPLAY],        6, 0);
-               SHOW(i4[IPSEC_STAT_IN_ESPREPLAY],       7, 0);
-               SHOW(i4[IPSEC_STAT_IN_AHAUTHSUCC],      8, 0);
-               SHOW(i4[IPSEC_STAT_IN_AHAUTHFAIL],      9, 0);
-
-               SHOW(i4[IPSEC_STAT_OUT_SUCCESS],        12, 0);
-               SHOW(i4[IPSEC_STAT_OUT_POLVIO],         13, 0);
-               SHOW(i4[IPSEC_STAT_OUT_NOSA],           14, 0);
-               SHOW(i4[IPSEC_STAT_OUT_INVAL],          15, 0);
-               SHOW(i4[IPSEC_STAT_OUT_NOROUTE],        16, 0);
-       }
-
-#ifdef INET6
-       if (namelist[1].n_type) {
-               SHOW(i6[IPSEC_STAT_IN_SUCCESS],         1, 35);
-               SHOW(i6[IPSEC_STAT_IN_POLVIO],          2, 35);
-               SHOW(i6[IPSEC_STAT_IN_NOSA],            3, 35);
-               SHOW(i6[IPSEC_STAT_IN_INVAL],           4, 35);
-               SHOW(i6[IPSEC_STAT_IN_BADSPI],          5, 35);
-               SHOW(i6[IPSEC_STAT_IN_AHREPLAY],        6, 35);
-               SHOW(i6[IPSEC_STAT_IN_ESPREPLAY],       7, 35);
-               SHOW(i6[IPSEC_STAT_IN_AHAUTHSUCC],      8, 35);
-               SHOW(i6[IPSEC_STAT_IN_AHAUTHFAIL],      9, 35);
-
-               SHOW(i6[IPSEC_STAT_OUT_SUCCESS],        12, 35);
-               SHOW(i6[IPSEC_STAT_OUT_POLVIO],         13, 35);
-               SHOW(i6[IPSEC_STAT_OUT_NOSA],           14, 35);
-               SHOW(i6[IPSEC_STAT_OUT_INVAL],          15, 35);
-               SHOW(i6[IPSEC_STAT_OUT_NOROUTE],        16, 35);
-       }
-#endif
-}
-
-int
-initipsec(void)
-{
-
-       if (! use_sysctl) {
-               int n;
-
-               if (namelist[0].n_type == 0) {
-                       n = kvm_nlist(kd, namelist);
-                       if (n < 0) {
-                               nlisterr(namelist);
-                               return(0);
-                       } else if (n == sizeof(namelist) /
-                                       sizeof(namelist[0]) - 1) {
-                               error("No namelist");
-                               return(0);
-                       }
-               }



Home | Main Index | Thread Index | Old Index