diff options
author | Jun Kuriyama <kuriyama@FreeBSD.org> | 2003-11-18 03:18:02 +0000 |
---|---|---|
committer | Jun Kuriyama <kuriyama@FreeBSD.org> | 2003-11-18 03:18:02 +0000 |
commit | bb25fde9242f916e28ab60e2d8de7b6b419674b7 (patch) | |
tree | f2f2184ab455f3516b09f10eb76f3807c9c277aa /net-mgmt/net-snmp-devel/files/patch-tcpTable.c | |
parent | Use Tcl/Tk 8.4 rather than 8.3. (diff) |
o Upgrade to 5.1 (bump shlib major to 6, use autoconf257).
o Add ${NET_SNMP_MIB_MODULES} which is "host smux ucd-snmp/diskio"
by default.
o Remove unused variables.
o Update various local patches around {tcp,udp}Table and
hr_{storage,system}.
Notes
Notes:
svn path=/head/; revision=94221
Diffstat (limited to 'net-mgmt/net-snmp-devel/files/patch-tcpTable.c')
-rw-r--r-- | net-mgmt/net-snmp-devel/files/patch-tcpTable.c | 75 |
1 files changed, 25 insertions, 50 deletions
diff --git a/net-mgmt/net-snmp-devel/files/patch-tcpTable.c b/net-mgmt/net-snmp-devel/files/patch-tcpTable.c index 19e1f60d7ca8..20f29239b95d 100644 --- a/net-mgmt/net-snmp-devel/files/patch-tcpTable.c +++ b/net-mgmt/net-snmp-devel/files/patch-tcpTable.c @@ -1,51 +1,26 @@ ---- agent/mibgroup/mibII/tcpTable.c.orig Sat Apr 20 16:30:05 2002 -+++ agent/mibgroup/mibII/tcpTable.c Sat Aug 16 17:38:05 2003 -@@ -462,6 +462,40 @@ - TCP_Count_Connections(void) - { - int Established; -+#if (defined(freebsd2) || defined(netbsd2) || defined(openbsd2)) -+ int mib[4], len; -+ char *p; -+ struct tcpcb *tpcb; -+ struct xtcpcb *tp; -+ struct xinpgen *next; -+ -+ mib[0]=CTL_NET; -+ mib[1]=PF_INET; -+ mib[2]=IPPROTO_TCP; -+ mib[3]=TCPCTL_PCBLIST; -+ -+ if (sysctl(mib, 4, NULL, &len, NULL, 0) != 0) { -+ snmp_log_perror("TCP_Count_Connections - sysctl"); -+ return 0; -+ } -+ if ((p=(char *)malloc(len)) == NULL) { -+ snmp_log_perror("TCP_Count_Connections - malloc"); -+ return 0; -+ } -+ if (sysctl(mib, 4, p, &len, NULL, 0) != 0) { -+ snmp_log_perror("TCP_Count_Connections - sysctl"); -+ free(p); -+ return 0; -+ } -+ Established=0; -+ next=(struct xinpgen *)p; -+ for (next=(struct xinpgen *)((char *)next + next->xig_len); next->xig_len > sizeof(struct xinpgen); next=(struct xinpgen *)((char *)next + next->xig_len)) { -+ tp=(struct xtcpcb *)next; -+ if (tp->xt_tp.t_state == TCPS_ESTABLISHED || tp->xt_tp.t_state == TCPS_CLOSE_WAIT) -+ Established++; -+ } -+ free(p); -+#else - struct inpcb cb; - register struct inpcb *next; - #if !(defined(freebsd2) || defined(netbsd2) || defined(openbsd2)) -@@ -525,6 +559,7 @@ - prev = next; - #endif /* !(defined(freebsd2) || defined(netbsd1) || defined(openbsd2)) */ - } +--- agent/mibgroup/mibII/tcpTable.c.orig Fri Nov 14 14:49:21 2003 ++++ agent/mibgroup/mibII/tcpTable.c Fri Nov 14 15:14:16 2003 +@@ -84,6 +84,8 @@ + #define TCPTABLE_REMOTEADDRESS pcb.inp_faddr.s_addr + #define TCPTABLE_REMOTEPORT pcb.inp_fport + #define TCPTABLE_IS_LINKED_LIST ++#undef INP_NEXT_SYMBOL ++#define INP_NEXT_SYMBOL inp_next + + #endif /* linux */ + #endif /* WIN32 */ +@@ -695,11 +697,13 @@ + nnew = SNMP_MALLOC_TYPEDEF(netsnmp_inpcb); + if (!nnew) + break; ++#if 0 + nnew->state = StateMap[((struct xinpcb *) xig)->xt_tp.t_state]; + if (nnew->state == 5 /* established */ || + nnew->state == 8 /* closeWait */ ) + tcp_estab++; +- memcpy(&(nnew->pcb), &(((struct xinpcb *) xig)->xt_inp), +#endif - return (Established); - } - #endif /* !linux && !hpux11 */ ++ memcpy(&(nnew->pcb), &(((struct xinpcb *) xig)->xi_inp), + sizeof(struct inpcb)); + + nnew->inp_next = tcp_head; |