patches to help build on Linux 2.2

This commit is contained in:
mcr 1999-10-17 21:37:10 +00:00
parent 2373cb681b
commit f6fa6a40d4
27 changed files with 267 additions and 263 deletions

View 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
;;
*)

View 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))

206
mib.h
View File

@ -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,

View 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>

View 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>

View 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 */

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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;
}

View 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

View File

@ -21,18 +21,18 @@
#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>

View File

@ -21,19 +21,19 @@
#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;
}

View File

@ -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.

View File

@ -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;