]> The Tcpdump Group git mirrors - tcpdump/commitdiff
patches to help build on Linux 2.2
authormcr <mcr>
Sun, 17 Oct 1999 21:37:10 +0000 (21:37 +0000)
committermcr <mcr>
Sun, 17 Oct 1999 21:37:10 +0000 (21:37 +0000)
27 files changed:
configure.in
interface.h
mib.h
print-atalk.c
print-atm.c
print-domain.c
print-dvmrp.c
print-ether.c
print-icmp.c
print-igrp.c
print-ip.c
print-ipx.c
print-krb.c
print-netbios.c
print-nfs.c
print-null.c
print-ospf.c
print-pim.c
print-raw.c
print-rip.c
print-sl.c
print-snmp.c
print-sunrpc.c
print-tcp.c
print-udp.c
tcpdump.1
tcpdump.c

index 70a4796c5159a8db25e789908feded55c4e1694a..7aee6c5ea1bb163bcf246ffae3f63ae9c6a770aa 100644 (file)
@@ -1,4 +1,4 @@
-dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.72 1999-10-09 23:57:19 mcr Exp $ (LBL)
+dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.73 1999-10-17 21:37:10 mcr Exp $ (LBL)
 dnl
 dnl Copyright (c) 1994, 1995, 1996, 1997
 dnl    The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,8 @@ linux*)
        if test $ac_cv_linux_vers -lt 2 ; then
                AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
        fi
-       AC_DEFINE(HAVE_NET_SLIP_H)
+dnl    AC_DEFINE(HAVE_NET_SLIP_H)
+dnl    this is not the case on 2.2.x, we need a better way of figuring this out
        ;;
 
 *)
index 3feeb4a47532a1f70b7f54b0aaf3c774f8f50aa3..6c6e0bbaa4857e2f5da7180ef0d4f36e4aab2f82 100644 (file)
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.105 1999-10-07 23:47:10 mcr Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.106 1999-10-17 21:37:10 mcr Exp $ (LBL)
  */
 
 #ifndef tcpdump_interface_h
@@ -52,6 +52,7 @@ extern int packettype;                /* as specified by -T */
 #define PT_RPC         3       /* Remote Procedure Call */
 #define PT_RTP         4       /* Real-Time Applications protocol */
 #define PT_RTCP                5       /* Real-Time Applications control protocol */
+#define PT_SNMP                6       /* Simple Network Management Protocol */
 
 #ifndef min
 #define min(a,b) ((a)>(b)?(b):(a))
diff --git a/mib.h b/mib.h
index 48ead9b9691bc84b67c63b6a817e349701d3261d..92c6c2c58f00b3c12c43f93d82a4de5148ecec24 100644 (file)
--- a/mib.h
+++ b/mib.h
@@ -1217,6 +1217,202 @@ _snmp_obj = {
        "snmp", 11, 0,
        &_snmpEnableAuthTraps_obj, &_transmission_obj
 },
+_usmMIBCompliances_obj = {
+       "usmMIBCompliances", 1, 0,
+       NULL, NULL
+},
+_usmMIBGroups_obj = {
+       "usmMIBGroups", 2, 0,
+       NULL, &_usmMIBCompliances_obj
+},
+_usmUserEngineID_obj = {
+       "usmUserEngineID", 1, 0,
+       NULL, NULL
+},
+_usmUserName_obj = {
+       "usmUserName", 2, 0,
+       NULL, &_usmUserEngineID_obj
+},
+_usmUserSecurityName_obj = {
+       "usmUserSecurityName", 3, 0,
+       NULL, &_usmUserName_obj
+},
+_usmUserCloneFrom_obj = {
+       "usmUserCloneFrom", 4, 0,
+       NULL, &_usmUserSecurityName_obj
+},
+_usmUserAuthProtocol_obj = {
+       "usmUserAuthProtocol", 5, 0,
+       NULL, &_usmUserCloneFrom_obj
+},
+_usmUserAuthKeyChange_obj = {
+       "usmUserAuthKeyChange", 6, 0,
+       NULL, &_usmUserAuthProtocol_obj
+},
+_usmUserOwnAuthKeyChange_obj = {
+       "usmUserOwnAuthKeyChange", 7, 0,
+       NULL, &_usmUserAuthKeyChange_obj
+},
+_usmUserPrivProtocol_obj = {
+       "usmUserPrivProtocol", 8, 0,
+       NULL, &_usmUserOwnAuthKeyChange_obj
+},
+_usmUserPrivKeyChange_obj = {
+       "usmUserPrivKeyChange", 9, 0,
+       NULL, &_usmUserPrivProtocol_obj
+},
+_usmUserOwnPrivKeyChange_obj = {
+       "usmUserOwnPrivKeyChange", 10, 0,
+       NULL, &_usmUserPrivKeyChange_obj
+},
+_usmUserPublic_obj = {
+       "usmUserPublic", 11, 0,
+       NULL, &_usmUserOwnPrivKeyChange_obj
+},
+_usmUserStorageType_obj = {
+       "usmUserStorageType", 12, 0,
+       NULL, &_usmUserPublic_obj
+},
+_usmUserStatus_obj = {
+       "usmUserStatus", 13, 0,
+       NULL, &_usmUserStorageType_obj
+},
+_usmUserEntry_obj = {
+       "usmUserEntry", 1, 0,
+       &_usmUserStatus_obj, NULL
+},
+_usmUserSpinLock_obj = {
+       "usmUserSpinLock", 1, 0,
+       NULL, NULL
+},
+_usmUserTable_obj = {
+       "usmUserTable", 2, 0,
+       &_usmUserEntry_obj, &_usmUserSpinLock_obj
+},
+_usmStatsUnsupportedSecLevels_obj = {
+       "usmStatsUnsupportedSecLevels", 1, 0,
+       NULL, NULL
+},
+_usmStatsNotInTimeWindows_obj = {
+       "usmStatsNotInTimeWindows", 2, 0,
+       NULL, &_usmStatsUnsupportedSecLevels_obj
+},
+_usmStatsUnknownUserNames_obj = {
+       "usmStatsUnknownUserNames", 3, 0,
+       NULL, &_usmStatsNotInTimeWindows_obj
+},
+_usmStatsUnknownEngineIDs_obj = {
+       "usmStatsUnknownEngineIDs", 4, 0,
+       NULL, &_usmStatsUnknownUserNames_obj
+},
+_usmStatsWrongDigests_obj = {
+       "usmStatsWrongDigests", 5, 0,
+       NULL, &_usmStatsUnknownEngineIDs_obj
+},
+_usmStatsDecryptionErrors_obj = {
+       "usmStatsDecryptionErrors", 6, 0,
+       NULL, &_usmStatsWrongDigests_obj
+},
+_usmStats_obj = {
+       "usmStats", 1, 0,
+       &_usmStatsDecryptionErrors_obj, NULL
+},
+_usmUser_obj = {
+       "usmUser", 2, 0,
+       &_usmUserTable_obj, &_usmStats_obj
+},
+_usmMIBObjects_obj = {
+       "usmMIBObjects", 1, 0,
+       &_usmUser_obj, NULL
+},
+_usmMIBConformance_obj = {
+       "usmMIBConformance", 2, 0,
+       &_usmMIBGroups_obj, &_usmMIBObjects_obj
+},
+_snmpMPDMIBCompliances_obj = {
+       "snmpMPDMIBCompliances", 1, 0,
+       NULL, NULL
+},
+_snmpMPDMIBGroups_obj = {
+       "snmpMPDMIBGroups", 2, 0,
+       NULL, &_snmpMPDMIBCompliances_obj
+},
+_snmpUnknownSecurityModels_obj = {
+       "snmpUnknownSecurityModels", 1, 0,
+       NULL, NULL
+},
+_snmpInvalidMsgs_obj = {
+       "snmpInvalidMsgs", 2, 0,
+       NULL, &_snmpUnknownSecurityModels_obj
+},
+_snmpUnknownPDUHandlers_obj = {
+       "snmpUnknownPDUHandlers", 3, 0,
+       NULL, &_snmpInvalidMsgs_obj
+},
+_snmpMPDStats_obj = {
+       "snmpMPDStats", 1, 0,
+       &_snmpUnknownPDUHandlers_obj, NULL
+},
+_snmpMPDAdmin_obj = {
+       "snmpMPDAdmin", 1, 0,
+       NULL, NULL
+},
+_snmpMPDMIBObjects_obj = {
+       "snmpMPDMIBObjects", 2, 0,
+       &_snmpMPDStats_obj, &_snmpMPDAdmin_obj
+},
+_snmpMPDMIBConformance_obj = {
+       "snmpMPDMIBConformance", 3, 0,
+       &_snmpMPDMIBGroups_obj, &_snmpMPDMIBObjects_obj
+},
+_snmpEngineID_obj = {
+       "snmpEngineID", 1, 0,
+       NULL, NULL
+},
+_snmpEngineBoots_obj = {
+       "snmpEngineBoots", 2, 0,
+       NULL, &_snmpEngineID_obj
+},
+_snmpEngineTime_obj = {
+       "snmpEngineTime", 3, 0,
+       NULL, &_snmpEngineBoots_obj
+},
+_snmpEngineMaxMessageSize_obj = {
+       "snmpEngineMaxMessageSize", 4, 0,
+       NULL, &_snmpEngineTime_obj
+},
+_snmpEngine_obj = {
+       "snmpEngine", 1, 0,
+       &_snmpEngineMaxMessageSize_obj, NULL
+},
+_snmpFrameworkAdmin_obj = {
+       "snmpFrameworkAdmin", 1, 0,
+       NULL, NULL
+},
+_snmpFrameworkMIBObjects_obj = {
+       "snmpFrameworkMIBObjects", 2, 0,
+       &_snmpEngine_obj, &_snmpFrameworkAdmin_obj
+},
+_snmpFrameworkMIBConformance_obj = {
+       "snmpFrameworkMIBConformance", 3, 0,
+       NULL, &_snmpFrameworkMIBObjects_obj
+},
+_snmpFrameworkMIB_obj = {
+       "snmpFrameworkMIB", 10, 0,
+       &_snmpFrameworkMIBConformance_obj, NULL
+},
+_snmpMPDMIB_obj = {
+       "snmpMPDMIB", 11, 0,
+       &_snmpMPDMIBConformance_obj, &_snmpFrameworkMIB_obj
+},
+_snmpUsmMIB_obj = {
+       "snmpUsmMIB", 15, 0,
+       &_usmMIBConformance_obj, &_snmpMPDMIB_obj
+},
+_snmpModules_obj = {
+       "snmpModules", 3, 0,
+       &_snmpUsmMIB_obj, NULL
+},
 _mib_obj = {
        "mib", 1, 0,
        &_snmp_obj, NULL
@@ -1237,9 +1433,17 @@ _private_obj = {
        "private", 4, 0,
        &_enterprises_obj, &_experimental_obj
 },
+_security_obj = {
+       "security", 5, 0,
+       NULL, &_private_obj
+},
+_snmpV2_obj = {
+       "snmpV2", 6, 0,
+       &_snmpModules_obj, &_security_obj
+},
 _internet_obj = {
        "internet", 1, 0,
-       &_private_obj, NULL
+       &_snmpV2_obj, NULL
 },
 _dod_obj = {
        "dod", 6, 0,
index 5bea933653e6efbac53360057042296fdd6782ab..e6782c0107e16fd50ef7d8b7fff92cbbad87729c 100644 (file)
@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.48 1999-10-07 23:47:11 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.49 1999-10-17 21:37:11 mcr Exp $ (LBL)";
 #endif
 
 #include <sys/param.h>
@@ -39,12 +39,9 @@ struct rtentry;
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
-#include <netinet/ip_var.h>
 #include <netinet/if_ether.h>
 #include <netinet/udp.h>
-#include <netinet/udp_var.h>
 #include <netinet/tcp.h>
-#include <netinet/tcpip.h>
 
 #include <stdio.h>
 #include <stdlib.h>
index 6d6463c9eb2e4653bdf02b35c1d591cbad823655..13f5369fd4ed66c90d7f9db7e7f2520fed119943 100644 (file)
@@ -20,7 +20,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.9 1999-10-07 23:47:11 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.10 1999-10-17 21:37:11 mcr Exp $ (LBL)";
 #endif
 
 #include <sys/param.h>
@@ -37,11 +37,8 @@ struct rtentry;
 #include <netinet/if_ether.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
-#include <netinet/ip_var.h>
 #include <netinet/udp.h>
-#include <netinet/udp_var.h>
 #include <netinet/tcp.h>
-#include <netinet/tcpip.h>
 
 #include <stdio.h>
 #include <pcap.h>
index ad3ee457996f95c86a751e8ab1fafa074ed7ea1b..498e9bc83edc7905f87f8c9db8382e4b3a2c5d79 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.39 1999-10-07 23:47:11 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.40 1999-10-17 21:37:11 mcr Exp $ (LBL)";
 #endif
 
 #include <sys/param.h>
@@ -38,11 +38,8 @@ struct rtentry;
 #include <netinet/if_ether.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
-#include <netinet/ip_var.h>
 #include <netinet/udp.h>
-#include <netinet/udp_var.h>
 #include <netinet/tcp.h>
-#include <netinet/tcpip.h>
 
 #ifdef NOERROR
 #undef NOERROR                                 /* Solaris sucks */
index b010678c452e02424284ee4fd186391c8e3cfb2f..a538405d4b7badd190a9bcc955fa2341e33c452e 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-dvmrp.c,v 1.13 1999-10-07 23:47:11 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-dvmrp.c,v 1.14 1999-10-17 21:37:12 mcr Exp $ (LBL)";
 #endif
 
 #include <sys/param.h>
@@ -31,11 +31,8 @@ static const char rcsid[] =
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
-#include <netinet/ip_var.h>
 #include <netinet/udp.h>
-#include <netinet/udp_var.h>
 #include <netinet/tcp.h>
-#include <netinet/tcpip.h>
 
 #include <stdio.h>
 #include <string.h>
index 5ec960249424d4099ba6c4c16ac1ba5eacdb9a1e..6c1c621ceda47079e82bc7b257f676aac14290cb 100644 (file)
@@ -20,7 +20,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.44 1999-10-07 23:47:11 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.45 1999-10-17 21:37:12 mcr Exp $ (LBL)";
 #endif
 
 #include <sys/param.h>
@@ -37,11 +37,8 @@ struct rtentry;
 #include <netinet/if_ether.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
-#include <netinet/ip_var.h>
 #include <netinet/udp.h>
-#include <netinet/udp_var.h>
 #include <netinet/tcp.h>
-#include <netinet/tcpip.h>
 
 #include <stdio.h>
 #include <pcap.h>
index 6155da1b73865a67899595a3ba256ab10e701a74..5eaddc30d42d839f58aaad5e1472d2b3b0224048 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-icmp.c,v 1.38 1999-10-07 23:47:11 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-icmp.c,v 1.39 1999-10-17 21:37:12 mcr Exp $ (LBL)";
 #endif
 
 #include <sys/param.h>
@@ -34,16 +34,15 @@ struct rtentry;
 #endif
 #include <net/if.h>
 
+#define __FAVOR_BSD
+
 #include <netinet/in.h>
 #include <netinet/if_ether.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
 #include <netinet/ip_icmp.h>
-#include <netinet/ip_var.h>
 #include <netinet/udp.h>
-#include <netinet/udp_var.h>
 #include <netinet/tcp.h>
-#include <netinet/tcpip.h>
 
 #include <stdio.h>
 #include <string.h>
index 4b687033322c663536266aea89333798491a12f6..3eaa40ef9a0ec193727c019496b5577a1a8b6cf0 100644 (file)
@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-igrp.c,v 1.8 1999-10-07 23:47:11 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-igrp.c,v 1.9 1999-10-17 21:37:12 mcr Exp $ (LBL)";
 #endif
 
 #include <sys/param.h>
@@ -33,9 +33,7 @@ static const char rcsid[] =
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
-#include <netinet/ip_var.h>
 #include <netinet/udp.h>
-#include <netinet/udp_var.h>
 
 #include <errno.h>
 #include <stdio.h>
index 61adf615cdbacdafdbbc86668a39637e8903fb85..49d9c540dbeb3ceda505ea1be30ebd7e1cf88724 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.66 1999-10-07 23:47:11 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.67 1999-10-17 21:37:13 mcr Exp $ (LBL)";
 #endif
 
 #include <sys/param.h>
@@ -31,11 +31,8 @@ static const char rcsid[] =
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
-#include <netinet/ip_var.h>
 #include <netinet/udp.h>
-#include <netinet/udp_var.h>
 #include <netinet/tcp.h>
-#include <netinet/tcpip.h>
 
 #ifdef HAVE_MALLOC_H
 #include <malloc.h>
index 268b01820499131bc9af5698a6f7cb4bce5896f1..dafd840984dcac19f5d097c92a8d99f889bb9ed7 100644 (file)
@@ -24,7 +24,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ipx.c,v 1.19 1999-10-07 23:47:11 mcr Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ipx.c,v 1.20 1999-10-17 21:37:13 mcr Exp $";
 #endif
 
 #include <sys/param.h>
@@ -34,11 +34,8 @@ static const char rcsid[] =
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
-#include <netinet/ip_var.h>
 #include <netinet/udp.h>
-#include <netinet/udp_var.h>
 #include <netinet/tcp.h>
-#include <netinet/tcpip.h>
 
 #ifdef __STDC__
 #include <stdlib.h>
index 645e28a131517b4ad6f32a1c653c3605e435a7d8..8e24b3a1f6a117783e91cd5d5c9ae09b81400343 100644 (file)
@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-krb.c,v 1.9 1999-10-07 23:47:11 mcr Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-krb.c,v 1.10 1999-10-17 21:37:13 mcr Exp $";
 #endif
 
 #include <sys/param.h>
@@ -33,9 +33,7 @@ static const char rcsid[] =
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
-#include <netinet/ip_var.h>
 #include <netinet/udp.h>
-#include <netinet/udp_var.h>
 
 #include <ctype.h>
 #include <errno.h>
index e3ecaa36ead9c273c4bd34c69a5c92588e367511..2de7e21e9d26f9ab1744cc3aeec985b99b14e47b 100644 (file)
@@ -24,7 +24,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-netbios.c,v 1.10 1999-10-07 23:47:12 mcr Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-netbios.c,v 1.11 1999-10-17 21:37:13 mcr Exp $";
 #endif
 
 #include <sys/param.h>
@@ -33,11 +33,8 @@ static const char rcsid[] =
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
-#include <netinet/ip_var.h>
 #include <netinet/udp.h>
-#include <netinet/udp_var.h>
 #include <netinet/tcp.h>
-#include <netinet/tcpip.h>
 
 #ifdef __STDC__
 #include <stdlib.h>
index ceaa5aa59c835248cb1c754e1845876769d0ddba..21703ba957ad91382d0ef9bf7cfd6ccf482a05fc 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-nfs.c,v 1.65 1999-10-07 23:47:12 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-nfs.c,v 1.66 1999-10-17 21:37:14 mcr Exp $ (LBL)";
 #endif
 
 #include <sys/param.h>
@@ -38,7 +38,6 @@ struct rtentry;
 #include <netinet/if_ether.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <rpc/rpc.h>
 
index bb7a1fd4ef12dcf0070e37fa9f6cac589746dece..13035720b1316f06ff6a103df7ec9d882c0c05c7 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.24 1999-10-07 23:47:12 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.25 1999-10-17 21:37:14 mcr Exp $ (LBL)";
 #endif
 
 #include <sys/param.h>
@@ -40,11 +40,8 @@ struct rtentry;
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
 #include <netinet/if_ether.h>
-#include <netinet/ip_var.h>
 #include <netinet/udp.h>
-#include <netinet/udp_var.h>
 #include <netinet/tcp.h>
-#include <netinet/tcpip.h>
 
 #include <pcap.h>
 #include <stdio.h>
index a3301cd333ca5227efe3b1004e08e8bbcaaf4684..92945b3929f66b85840a5bcb2ea609e4a023917f 100644 (file)
@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.24 1999-10-07 23:47:12 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.25 1999-10-17 21:37:14 mcr Exp $ (LBL)";
 #endif
 
 #include <sys/param.h>
@@ -33,7 +33,6 @@ static const char rcsid[] =
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <ctype.h>
 #include <stdio.h>
index 2714c09eb4693de92181aa8f0daba211af17606b..529e1aaadc8e449bb4e50dbb167afa8c9fc9d7ce 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.7 1999-10-07 23:47:12 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.8 1999-10-17 21:37:14 mcr Exp $ (LBL)";
 #endif
 
 #include <sys/param.h>
@@ -31,11 +31,8 @@ static const char rcsid[] =
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
-#include <netinet/ip_var.h>
 #include <netinet/udp.h>
-#include <netinet/udp_var.h>
 #include <netinet/tcp.h>
-#include <netinet/tcpip.h>
 
 #include <stdio.h>
 #include <stdlib.h>
index a0452aec853d344f7505716202aa29408f452c5b..932252ba5b85e3cf4c4002943b73fa1ca658ad28 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-raw.c,v 1.22 1999-10-07 23:47:12 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-raw.c,v 1.23 1999-10-17 21:37:15 mcr Exp $ (LBL)";
 #endif
 
 #include <sys/param.h>
@@ -40,11 +40,8 @@ struct rtentry;
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
 #include <netinet/if_ether.h>
-#include <netinet/ip_var.h>
 #include <netinet/udp.h>
-#include <netinet/udp_var.h>
 #include <netinet/tcp.h>
-#include <netinet/tcpip.h>
 
 #include <pcap.h>
 #include <stdio.h>
index 9ad32ceb782b846991998cee424a847ddde3045e..7fcc5aa047b8fe51f7cdb8c6be38ddb428466ebe 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-rip.c,v 1.36 1999-10-07 23:47:12 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-rip.c,v 1.37 1999-10-17 21:37:15 mcr Exp $ (LBL)";
 #endif
 
 #include <sys/param.h>
@@ -31,9 +31,7 @@ static const char rcsid[] =
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
-#include <netinet/ip_var.h>
 #include <netinet/udp.h>
-#include <netinet/udp_var.h>
 
 #include <stdio.h>
 
index c8d5b86b1d184ad35d376110be53e4ad19e783e4..f24633ecd28ea107421fc9e1f263eaebd099f082 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-sl.c,v 1.42 1999-10-07 23:47:12 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-sl.c,v 1.43 1999-10-17 21:37:15 mcr Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_NET_SLIP_H
@@ -42,11 +42,8 @@ struct rtentry;
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
 #include <netinet/if_ether.h>
-#include <netinet/ip_var.h>
 #include <netinet/udp.h>
-#include <netinet/udp_var.h>
 #include <netinet/tcp.h>
-#include <netinet/tcpip.h>
 
 #include <net/slcompress.h>
 #include <net/slip.h>
index d67a6110c61be49790e15be5c70f41da970c099c..572429d04bd4ed7d2f142511d381d61156dba52e 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-snmp.c,v 1.34 1999-10-17 21:12:42 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-snmp.c,v 1.35 1999-10-17 21:37:15 mcr Exp $ (LBL)";
 #endif
 
 #include <sys/param.h>
@@ -94,11 +94,7 @@ char *Application[] = {
 #define GAUGE 2
        "TimeTicks",
 #define TIMETICKS 3
-       "Opaque",
-#define OPAQUE 4
-       "C-5",
-       "Counter64"
-#define COUNTER64 6
+       "Opaque"
 };
 
 /*
@@ -113,28 +109,8 @@ char *Context[] = {
 #define GETRESP 2
        "SetRequest",
 #define SETREQ 3
-       "Trap",
+       "Trap"
 #define TRAP 4
-       "GetBulk",
-#define GETBULKREQ 5
-       "Inform",
-#define INFORMREQ 6
-       "V2Trap",
-#define V2TRAP 7
-       "Report"
-#define REPORT 8
-};
-
-/*
- * Context-specific ASN.1 types for the SNMP Exceptions and their tags
- */
-char *Exceptions[] = {
-       "noSuchObject",
-#define NOSUCHOBJECT 0
-       "noSuchInstance",
-#define NOSUCHINSTANCE 1
-       "endOfMibView",
-#define ENDOFMIBVIEW 2
 };
 
 /*
@@ -154,23 +130,10 @@ char *ErrorStatus[] = {
        "noSuchName",
        "badValue",
        "readOnly",
-       "genErr",
-       "noAccess",
-       "wrongType",
-       "wrongLength",
-       "wrongEncoding",
-       "wrongValue",
-       "noCreation",
-       "inconsistentValue",
-       "resourceUnavailable",
-       "commitFailed",
-       "undoFailed",
-       "authorizationError",
-       "notWritable",
-       "inconsistentName"
+       "genErr"
 };
 #define DECODE_ErrorStatus(e) \
-       ( e >= 0 && e < sizeof(ErrorStatus)/sizeof(ErrorStatus[0]) \
+       ( e >= 0 && e <= sizeof(ErrorStatus)/sizeof(ErrorStatus[0]) \
        ? ErrorStatus[e] : (sprintf(errbuf, "err=%u", e), errbuf))
 
 /*
@@ -187,7 +150,7 @@ char *GenericTrap[] = {
 #define GT_ENTERPRISE 7
 };
 #define DECODE_GenericTrap(t) \
-       ( t >= 0 && t < sizeof(GenericTrap)/sizeof(GenericTrap[0]) \
+       ( t >= 0 && t <= sizeof(GenericTrap)/sizeof(GenericTrap[0]) \
        ? GenericTrap[t] : (sprintf(buf, "gt=%d", t), buf))
 
 /*
@@ -209,8 +172,6 @@ struct {
 #define        CONTEXT         2
        defineCLASS(Private),
 #define        PRIVATE         3
-       defineCLASS(Exceptions),
-#define EXCEPTIONS     4
 };
 
 /*
@@ -299,10 +260,6 @@ struct be {
                int32_t integer;
                u_int32_t uns;
                const u_char *str;
-               struct {
-                       u_int32_t high;
-                       u_int32_t low;
-               } uns64;
        } data;
        u_short id;
        u_char form, class;             /* tag info */
@@ -318,29 +275,13 @@ struct be {
 #define BE_SEQ         7
 #define BE_INETADDR    8
 #define BE_PDU         9
-#define BE_UNS64       10
-#define BE_NOSUCHOBJECT        128
-#define BE_NOSUCHINST  129
-#define BE_ENDOFMIBVIEW        130
 };
 
-/*
- * SNMP versions recognized by this module
- */
-char *SnmpVersion[] = {
-       "SNMPv1",
-#define SNMP_VERSION_1 0
-       "SNMPv2"
-#define SNMP_VERSION_2 1
-};
-#define DECODE_SnmpVersion(v) \
-       ( v >= 0 && v < sizeof(SnmpVersion)/sizeof(SnmpVersion[0]) \
-       ? SnmpVersion[v] : (sprintf(versionbuf, "version=%u", v), versionbuf))
-
 /*
  * Defaults for SNMP PDU components
  */
 #define DEF_COMMUNITY "public"
+#define DEF_VERSION 0
 
 /*
  * constants for ASN.1 decoding
@@ -530,20 +471,6 @@ asn1_parse(register const u_char *p, u_int len, struct be *elem)
                                break;
                        }
 
-                       case COUNTER64: {
-                               register u_int32_t high, low;
-                               elem->type = BE_UNS64;
-                               high = 0, low = 0;
-                               for (i = elem->asnlen; i-- > 0; p++) {
-                                       high = (high << 8) | 
-                                           ((low & 0xFF000000) >> 24);
-                                       low = (low << 8) | *p;
-                               }
-                               elem->data.uns64.high = high;
-                               elem->data.uns64.low = low;
-                               break;
-                       }
-
                        default:
                                elem->type = BE_OCTET;
                                elem->data.raw = (caddr_t)p;
@@ -553,25 +480,6 @@ asn1_parse(register const u_char *p, u_int len, struct be *elem)
                        }
                        break;
 
-               case CONTEXT:
-                       switch (id) {
-                       case NOSUCHOBJECT:
-                               elem->type = BE_NOSUCHOBJECT;
-                               elem->data.raw = NULL;
-                               break;
-
-                       case NOSUCHINSTANCE:
-                               elem->type = BE_NOSUCHINST;
-                               elem->data.raw = NULL;
-                               break;
-
-                       case ENDOFMIBVIEW:
-                               elem->type = BE_ENDOFMIBVIEW;
-                               elem->data.raw = NULL;
-                               break;
-                       }
-                       break;
-
                default:
                        elem->type = BE_OCTET;
                        elem->data.raw = (caddr_t)p;
@@ -687,39 +595,6 @@ asn1_print(struct be *elem)
                printf("%d", elem->data.uns);
                break;
 
-       case BE_UNS64: {        /* idea borrowed from by Marshall Rose */
-               double d;
-               int j, carry;
-               char *cpf, *cpl, last[6], first[30];
-               if (elem->data.uns64.high == 0) {
-                       printf("%u", elem->data.uns64.low);
-                       break;
-               }
-               d = elem->data.uns64.high * 4294967296.0;       /* 2^32 */
-               if (elem->data.uns64.high <= 0x1fffff) { 
-                       d += elem->data.uns64.low;
-                       printf("%.f", d);
-                       break;
-               }
-               d += (elem->data.uns64.low & 0xfffff000);
-               sprintf(first, "%.f", d);
-               sprintf(last, "%5.5d", elem->data.uns64.low & 0xfff);
-               for (carry = 0, cpf = first+strlen(first)-1, cpl = last+4;
-                    cpl >= last;
-                    cpf--, cpl--) {
-                       j = carry + (*cpf - '0') + (*cpl - '0');
-                       if (j > 9) {
-                               j -= 10;
-                               carry = 1;
-                       } else {
-                               carry = 0;
-                       }
-                       *cpf = j + '0';
-               }
-               fputs(first, stdout);
-               break;
-       }
-
        case BE_STR: {
                register int printable = 1, first = 1;
                const u_char *p = elem->data.str;
@@ -755,12 +630,6 @@ asn1_print(struct be *elem)
                break;
        }
 
-       case BE_NOSUCHOBJECT:
-       case BE_NOSUCHINST:
-       case BE_ENDOFMIBVIEW:
-               printf("[%s]", Class[EXCEPTIONS].Id[elem->id]);
-               break;
-
        case BE_PDU:
                printf("%s(%u)",
                        Class[CONTEXT].Id[elem->id], elem->asnlen);
@@ -899,15 +768,13 @@ varbind_print(u_char pduid, const u_char *np, u_int length, int error)
                length -= count;
                np += count;
 
-               if (pduid != GETREQ && pduid != GETNEXTREQ
-                   && pduid != GETBULKREQ && !error)
+               if (pduid != GETREQ && pduid != GETNEXTREQ && !error)
                                fputs("=", stdout);
 
                /* objVal (ANY) */
                if ((count = asn1_parse(np, length, &elem)) < 0)
                        return;
-               if (pduid == GETREQ || pduid == GETNEXTREQ
-                   || pduid == GETBULKREQ) {
+               if (pduid == GETREQ || pduid == GETNEXTREQ) {
                        if (elem.type != BE_NULL) {
                                fputs("[objVal!=NULL]", stdout);
                                asn1_print(&elem);
@@ -924,8 +791,7 @@ varbind_print(u_char pduid, const u_char *np, u_int length, int error)
 }
 
 /*
- * Decode SNMP PDUs: GetRequest, GetNextRequest, GetResponse, SetRequest,
- * GetBulk, Inform, V2Trap, and Report
+ * Decode SNMP PDUs: GetRequest, GetNextRequest, GetResponse, and SetRequest
  */
 static void
 snmppdu_print(u_char pduid, const u_char *np, u_int length)
@@ -954,14 +820,11 @@ snmppdu_print(u_char pduid, const u_char *np, u_int length)
                return;
        }
        error = 0;
-       if ((pduid == GETREQ || pduid == GETNEXTREQ || pduid == SETREQ
-           || pduid == INFORMREQ || pduid == V2TRAP || pduid == REPORT)
+       if ((pduid == GETREQ || pduid == GETNEXTREQ)
            && elem.data.integer != 0) {
                char errbuf[10];
                printf("[errorStatus(%s)!=0]",
                        DECODE_ErrorStatus(elem.data.integer));
-       } else if (pduid == GETBULKREQ) {
-               printf(" N=%d", elem.data.integer);
        } else if (elem.data.integer != 0) {
                char errbuf[10];
                printf(" %s", DECODE_ErrorStatus(elem.data.integer));
@@ -978,12 +841,9 @@ snmppdu_print(u_char pduid, const u_char *np, u_int length)
                asn1_print(&elem);
                return;
        }
-       if ((pduid == GETREQ || pduid == GETNEXTREQ || pduid == SETREQ
-           || pduid == INFORMREQ || pduid == V2TRAP || pduid == REPORT)
+       if ((pduid == GETREQ || pduid == GETNEXTREQ)
            && elem.data.integer != 0)
                printf("[errorIndex(%d)!=0]", elem.data.integer);
-       else if (pduid == GETBULKREQ)
-               printf(" M=%d", elem.data.integer);
        else if (elem.data.integer != 0) {
                if (!error)
                        printf("[errorIndex(%d) w/o errorStatus]",
@@ -1098,7 +958,6 @@ snmp_print(const u_char *np, u_int length)
 {
        struct be elem, pdu;
        int count = 0;
-       int version = 0;
 
        truncated = 0;
 
@@ -1131,22 +990,11 @@ snmp_print(const u_char *np, u_int length)
                asn1_print(&elem);
                return;
        }
-       /* only handle version==0 || version==1 */
-       switch (elem.data.integer) {
-       case SNMP_VERSION_1:
-       case SNMP_VERSION_2: {
-               char versionbuf[10];
-               if (vflag)
-                       printf("%s ", DECODE_SnmpVersion(elem.data.integer));
-               break;
-       }
-       default: {
-               char versionbuf[10];
-               printf("[%s]", DECODE_SnmpVersion(elem.data.integer));
+       /* only handle version==0 */
+       if (elem.data.integer != DEF_VERSION) {
+               printf("[version(%d)!=0]", elem.data.integer);
                return;
        }
-       }
-       version = elem.data.integer;
        length -= count;
        np += count;
 
@@ -1180,18 +1028,6 @@ snmp_print(const u_char *np, u_int length)
        length = pdu.asnlen;
        np = (u_char *)pdu.data.raw;
 
-       if (version == SNMP_VERSION_1 &&
-           (pdu.id == GETBULKREQ || pdu.id == INFORMREQ || 
-            pdu.id == V2TRAP || pdu.id == REPORT)) {
-               printf("[v2 PDU in v1 message]");
-               return;
-       }
-
-       if (version == SNMP_VERSION_2 && pdu.id == TRAP) {
-               printf("[v1 PDU in v2 message]");
-               return;
-       }
-
        switch (pdu.id) {
        case TRAP:
                trap_print(np, length);
@@ -1200,10 +1036,6 @@ snmp_print(const u_char *np, u_int length)
        case GETNEXTREQ:
        case GETRESP:
        case SETREQ:
-       case GETBULKREQ:
-       case INFORMREQ:
-       case V2TRAP:
-       case REPORT:
                snmppdu_print(pdu.id, np, length);
                break;
        }
index 6a39c3fdf141cb85329663e89091f410caf90b6a..30f7d2a457a18383a6a4ca62848a072ed97aad98 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-sunrpc.c,v 1.26 1999-10-07 23:47:12 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-sunrpc.c,v 1.27 1999-10-17 21:37:16 mcr Exp $ (LBL)";
 #endif
 
 #include <sys/param.h>
@@ -38,7 +38,6 @@ struct rtentry;
 #include <netinet/if_ether.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
-#include <netinet/ip_var.h>
 
 #include <rpc/rpc.h>
 #ifdef HAVE_RPC_RPCENT_H
index f841a63714f4dea05e9d79cdd0c6b191e5d5a898..ffce8b956737710eeaaf86c333154692c2502d05 100644 (file)
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.55 1999-10-07 23:47:12 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.56 1999-10-17 21:37:16 mcr Exp $ (LBL)";
 #endif
 
 #include <sys/param.h>
 #include <sys/time.h>
 
+#define __FAVOR_BSD
+
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
-#include <netinet/ip_var.h>
 #include <netinet/tcp.h>
-#include <netinet/tcpip.h>
 
 #ifdef HAVE_MEMORY_H
 #include <memory.h>
index dcd791371792074893f69c60e7ec5741c7886bc3..465e64d3925b021b2ebefbc9f560a14b4fc8bc9f 100644 (file)
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.60 1999-10-07 23:47:12 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.61 1999-10-17 21:37:16 mcr Exp $ (LBL)";
 #endif
 
 #include <sys/param.h>
 #include <sys/time.h>
 #include <sys/socket.h>
 
+#define __FAVOR_BSD
+
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
-#include <netinet/ip_var.h>
 #include <netinet/udp.h>
-#include <netinet/udp_var.h>
 
 #ifdef NOERROR
 #undef NOERROR                                 /* Solaris sucks */
@@ -374,6 +374,15 @@ udp_print(register const u_char *bp, u_int length, register const u_char *bp2)
                        while (cp < ep)
                                cp = rtcp_print(cp, ep);
                        break;
+
+               case PT_SNMP:
+                       (void)printf("%s.%s > %s.%s:",
+                                ipaddr_string(&ip->ip_src),
+                                udpport_string(sport),
+                                ipaddr_string(&ip->ip_dst),
+                                udpport_string(dport));
+                       snmp_print((const u_char *)(up + 1), length);
+                       break;
                }
                return;
        }
index 8f42b1ea117e3fbe8c12ba112269aabc9f63a1d8..09a6ecb103034f84181b38fd966a4d203887fa2d 100644 (file)
--- a/tcpdump.1
+++ b/tcpdump.1
@@ -1,4 +1,4 @@
-.\" @(#) $Header: /tcpdump/master/tcpdump/Attic/tcpdump.1,v 1.67 1999-10-07 23:47:13 mcr Exp $ (LBL)
+.\" @(#) $Header: /tcpdump/master/tcpdump/Attic/tcpdump.1,v 1.68 1999-10-17 21:37:16 mcr Exp $ (LBL)
 .\"
 .\" Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997
 .\"    The Regents of the University of California.  All rights reserved.
@@ -185,8 +185,9 @@ specified \fItype\fR. Currently known types are
 \fBrtp\fR (Real-Time Applications protocol),
 \fBrtcp\fR (Real-Time Applications control protocol),
 \fBvat\fR (Visual Audio Tool),
+\fBwb\fR (distributed White Board),
 and
-\fBwb\fR (distributed White Board).
+\fBsnmp\fR (Simple Network Management Protocol).
 .TP
 .B \-S
 Print absolute, rather than relative, TCP sequence numbers.
index f04061d4ce8c720a6ad2e346e87daa3b93b3cc18..fbc4112874a99aebaee5c9cca5b546c72fb86948 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -24,7 +24,7 @@ static const char copyright[] =
     "@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997\n\
 The Regents of the University of California.  All rights reserved.\n";
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.129 1999-10-07 23:47:13 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.130 1999-10-17 21:37:17 mcr Exp $ (LBL)";
 #endif
 
 /*
@@ -239,6 +239,8 @@ main(int argc, char **argv)
                                packettype = PT_RTP;
                        else if (strcasecmp(optarg, "rtcp") == 0)
                                packettype = PT_RTCP;
+                       else if (strcasecmp(optarg, "snmp") == 0)
+                               packettype = PT_SNMP;
                        else
                                error("unknown packet type `%s'", optarg);
                        break;