-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.
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
;;
*)
* 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
#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))
"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
"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,
#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>
#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>
*/
#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>
#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>
#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>
#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 */
#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>
#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>
*/
#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>
#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>
#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>
#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>
#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>
#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>
#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>
#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>
#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>
#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>
#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>
#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>
#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>
#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>
#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>
#include <netinet/if_ether.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
-#include <netinet/ip_var.h>
#include <rpc/rpc.h>
#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>
#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>
#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>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
-#include <netinet/ip_var.h>
#include <ctype.h>
#include <stdio.h>
#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>
#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>
#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>
#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>
#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>
#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>
#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
#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>
#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>
#define GAUGE 2
"TimeTicks",
#define TIMETICKS 3
- "Opaque",
-#define OPAQUE 4
- "C-5",
- "Counter64"
-#define COUNTER64 6
+ "Opaque"
};
/*
#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
};
/*
"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))
/*
#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))
/*
#define CONTEXT 2
defineCLASS(Private),
#define PRIVATE 3
- defineCLASS(Exceptions),
-#define EXCEPTIONS 4
};
/*
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 */
#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
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;
}
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;
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;
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);
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);
}
/*
- * 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)
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));
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]",
{
struct be elem, pdu;
int count = 0;
- int version = 0;
truncated = 0;
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;
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);
case GETNEXTREQ:
case GETRESP:
case SETREQ:
- case GETBULKREQ:
- case INFORMREQ:
- case V2TRAP:
- case REPORT:
snmppdu_print(pdu.id, np, length);
break;
}
#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>
#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
#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>
#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 */
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;
}
-.\" @(#) $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.
\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.
"@(#) 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
/*
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;