pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/net/net-snmp/patches Look what you made me do clown bo...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/07a179637e3d
branches:  trunk
changeset: 543954:07a179637e3d
user:      christos <christos%pkgsrc.org@localhost>
date:      Sat Jun 28 16:06:34 2008 +0000

description:
Look what you made me do clown boy! (Adapt to new tcp stats array)

diffstat:

 net/net-snmp/patches/patch-dl |  89 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 85 insertions(+), 4 deletions(-)

diffs (104 lines):

diff -r ebc338525754 -r 07a179637e3d net/net-snmp/patches/patch-dl
--- a/net/net-snmp/patches/patch-dl     Sat Jun 28 12:34:48 2008 +0000
+++ b/net/net-snmp/patches/patch-dl     Sat Jun 28 16:06:34 2008 +0000
@@ -1,11 +1,16 @@
-$NetBSD: patch-dl,v 1.3 2007/02/05 12:06:16 adam Exp $
+$NetBSD: patch-dl,v 1.4 2008/06/28 16:06:34 christos Exp $
 
---- agent/mibgroup/mibII/tcp.c.orig    2006-09-15 02:48:40.000000000 +0200
-+++ agent/mibgroup/mibII/tcp.c
-@@ -177,6 +177,11 @@ init_tcp(void)
+--- agent/mibgroup/mibII/tcp.c.orig    2007-07-16 19:59:44.000000000 -0400
++++ agent/mibgroup/mibII/tcp.c 2008-06-28 11:15:21.000000000 -0400
+@@ -177,6 +177,16 @@
  #define USES_TRADITIONAL_TCPSTAT
  #endif
  
++#ifdef TCP_NSTATS
++typedef uint32_t tcp_stats[TCP_NSTATS];
++#define TCP_STAT_STRUCTURE    tcp_stats
++#endif
++
 +#ifdef dragonfly
 +#define TCP_STAT_STRUCTURE    struct tcp_stats
 +#define USES_TRADITIONAL_TCPSTAT
@@ -14,3 +19,79 @@
  #if !defined(TCP_STAT_STRUCTURE)
  #define TCP_STAT_STRUCTURE    struct tcpstat
  #define USES_TRADITIONAL_TCPSTAT
+@@ -309,6 +319,75 @@
+ #endif                        /* linux */
+         netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+         continue;
++#elif defined(TCP_NSTAT)
++    case TCPRTOALGORITHM:      /* Assume Van Jacobsen's algorithm */
++        ret_value = 4;
++        type = ASN_INTEGER;
++        break;
++    case TCPRTOMIN:
++#ifdef TCPTV_NEEDS_HZ
++        ret_value = TCPTV_MIN;
++#else
++        ret_value = TCPTV_MIN / PR_SLOWHZ * 1000;
++#endif
++        type = ASN_INTEGER;
++        break;
++    case TCPRTOMAX:
++#ifdef TCPTV_NEEDS_HZ
++        ret_value = TCPTV_REXMTMAX;
++#else
++        ret_value = TCPTV_REXMTMAX / PR_SLOWHZ * 1000;
++#endif
++        type = ASN_INTEGER;
++        break;
++    case TCPMAXCONN:
++        ret_value = -1;               /* Dynamic maximum */
++        type = ASN_INTEGER;
++        break;
++    case TCPACTIVEOPENS:
++        ret_value = tcpstat[TCP_STAT_CONNATTEMPT];
++        break;
++    case TCPPASSIVEOPENS:
++        ret_value = tcpstat[TCP_STAT_ACCEPTS];
++        break;
++        /*
++         * NB:  tcps_drops is actually the sum of the two MIB
++         *      counters tcpAttemptFails and tcpEstabResets.
++         */
++    case TCPATTEMPTFAILS:
++        ret_value = tcpstat[TCP_STAT_CONNDROPS];
++        break;
++    case TCPESTABRESETS:
++        ret_value = tcpstat[TCP_STAT_DROPS];
++        break;
++    case TCPCURRESTAB:
++#ifdef USING_MIBII_TCPTABLE_MODULE
++        ret_value = TCP_Count_Connections();
++#else
++        ret_value = 0;
++#endif
++        type = ASN_GAUGE;
++        break;
++    case TCPINSEGS:
++        ret_value = tcpstat[TCP_STAT_RCVTOTAL];
++        break;
++    case TCPOUTSEGS:
++        /*
++         * RFC 1213 defines this as the number of segments sent
++         * "excluding those containing only retransmitted octets"
++         */
++        ret_value = tcpstat[TCP_STAT_SNDTOTAL] - tcpstat[TCP_STAT_SNDREXMITPACK];
++        break;
++    case TCPRETRANSSEGS:
++        ret_value = tcpstat[TCP_STAT_SNDREXMITPACK];
++        break;
++    case TCPINERRS:
++        ret_value = tcpstat[TCP_STAT_RCVBADSUM] + tcpstat[TCP_STAT_RCVBADOFF]
++            + tcpstat[TCP_STAT_RCVMEMDROP] + tcpstat[TCP_STAT_RCVSHORT];
++        break;
++    case TCPOUTRSTS:
++        ret_value = tcpstat[TCP_STAT_SNDCTRL] - tcpstat[TCP_STAT_CLOSED];
++        break;
+ #elif defined(USES_TRADITIONAL_TCPSTAT) && !defined(_USE_FIRST_PROTOCOL)
+ #ifdef HAVE_SYS_TCPIPSTATS_H
+     /*



Home | Main Index | Thread Index | Old Index