Add tethereal's tap objects to Makefile.nmake's "clean" target.

Instead of setting MIBDIRS in tethereal.c and gtk/main.c, set it in
packet-snmp.c.

svn path=/trunk/; revision=6606
This commit is contained in:
Gerald Combs 2002-11-10 20:53:06 +00:00
parent f37932ff64
commit 2329ea1483
4 changed files with 32 additions and 43 deletions

View File

@ -1,7 +1,7 @@
## Makefile for building ethereal.exe with Microsoft C and nmake
## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
#
# $Id: Makefile.nmake,v 1.254 2002/11/06 21:49:29 guy Exp $
# $Id: Makefile.nmake,v 1.255 2002/11/10 20:53:03 gerald Exp $
include config.nmake
include <win32.mak>
@ -574,8 +574,9 @@ text2pcap-scanner.c : text2pcap-scanner.l
$(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
clean:
rm -f $(ethereal_OBJECTS) $(EXTRA_OBJECTS) $(EXECUTABLES) $(PDB_FILE) \
tethereal.obj editcap.obj mergecap.obj text2pcap.obj \
rm -f $(ethereal_OBJECTS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) \
$(EXECUTABLES) $(PDB_FILE) \
editcap.obj mergecap.obj text2pcap.obj \
text2pcap-scanner.obj text2pcap-scanner.c register.c \
rdps.obj rdps.pdb config.h ps.c \
rdps.exe rdps.ilk dftest.obj dftest.exe randpkt.obj randpkt.ext \

View File

@ -1,6 +1,6 @@
/* main.c
*
* $Id: main.c,v 1.275 2002/11/10 11:41:45 oabad Exp $
* $Id: main.c,v 1.276 2002/11/10 20:53:06 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -1378,11 +1378,6 @@ main(int argc, char *argv[])
#ifdef WIN32
WSADATA wsaData;
# ifdef HAVE_SOME_SNMP
char *mib_path;
# define MIB_PATH_APPEND "\\snmp\\mibs"
# endif /* HAVE_SOME_SNMP */
#endif /* WIN32 */
char *gpf_path, *cf_path, *df_path;
@ -1941,19 +1936,6 @@ main(int argc, char *argv[])
/* Start windows sockets */
WSAStartup( MAKEWORD( 1, 1 ), &wsaData );
# ifdef HAVE_SOME_SNMP
/* Set MIBDIRS so that the SNMP library can find its mibs. */
/* XXX - Should we set MIBS or MIBFILES as well? */
mib_path = g_malloc (strlen(get_datafile_dir()) + strlen(MIB_PATH_APPEND) + 20);
sprintf (mib_path, "MIBDIRS=%s\\%s", get_datafile_dir(), MIB_PATH_APPEND);
/* Amazingly enough, Windows does not provide setenv(). */
if (getenv("MIBDIRS") == NULL)
_putenv(mib_path);
g_free(mib_path);
# endif /* HAVE_UCD_SNMP */
#endif /* WIN32 */
/* Notify all registered modules that have had any of their preferences

View File

@ -10,7 +10,7 @@
*
* See RFCs 2570-2576 for SNMPv3
*
* $Id: packet-snmp.c,v 1.100 2002/10/24 07:08:22 guy Exp $
* $Id: packet-snmp.c,v 1.101 2002/11/10 20:53:03 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -54,6 +54,7 @@
#include "packet-ipx.h"
#ifdef HAVE_SOME_SNMP
#ifdef HAVE_NET_SNMP
# include <net-snmp/net-snmp-config.h>
# include <net-snmp/mib_api.h>
@ -75,6 +76,10 @@
# define NETSNMP_DS_LIB_PRINT_SUFFIX_ONLY DS_LIB_PRINT_SUFFIX_ONLY
#endif /* HAVE_NET_SNMP */
#ifdef WIN32
# include <epan/filesystem.h>
#endif /* WIN32 */
/*
* Define values "sprint_realloc_value()" expects.
*/
@ -2003,7 +2008,12 @@ dissect_smux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
void
proto_register_snmp(void)
{
static hf_register_info hf[] = {
#ifdef WIN32 && HAVE_SOME_SNMP
char *mib_path;
#define MIB_PATH_APPEND "snmp\\mibs"
#endif
static hf_register_info hf[] = {
{ &hf_snmpv3_flags,
{ "SNMPv3 Flags", "snmpv3.flags", FT_UINT8, BASE_HEX, NULL,
0x0, "", HFILL }},
@ -2028,6 +2038,20 @@ proto_register_snmp(void)
};
#ifdef HAVE_SOME_SNMP
#ifdef WIN32
/* Set MIBDIRS so that the SNMP library can find its mibs. */
/* XXX - Should we set MIBS or MIBFILES as well? */
mib_path = g_malloc (strlen(get_datafile_dir()) + strlen(MIB_PATH_APPEND) + 20);
sprintf (mib_path, "MIBDIRS=%s\\%s", get_datafile_dir(), MIB_PATH_APPEND);
/* Amazingly enough, Windows does not provide setenv(). */
if (getenv("MIBDIRS") == NULL)
_putenv(mib_path);
g_free(mib_path);
#endif /* WIN32 */
/*
* Suppress warnings about unknown tokens - we aren't initializing
* UCD SNMP in its entirety, we're just initializing the

View File

@ -1,6 +1,6 @@
/* tethereal.c
*
* $Id: tethereal.c,v 1.169 2002/11/09 00:08:42 guy Exp $
* $Id: tethereal.c,v 1.170 2002/11/10 20:53:03 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -348,11 +348,6 @@ main(int argc, char *argv[])
#ifdef WIN32
WSADATA wsaData;
# ifdef HAVE_SOME_SNMP
char *mib_path;
# define MIB_PATH_APPEND "\\snmp\\mibs"
# endif /* HAVE_UCD_SNMP */
#endif /* WIN32 */
char *gpf_path;
@ -809,19 +804,6 @@ main(int argc, char *argv[])
#ifdef WIN32
/* Start windows sockets */
WSAStartup( MAKEWORD( 1, 1 ), &wsaData );
# ifdef HAVE_SOME_SNMP
/* Set MIBDIRS so that the SNMP library can find its mibs. */
/* XXX - Should we set MIBS or MIBFILES as well? */
mib_path = g_malloc (strlen(get_datafile_dir()) + strlen(MIB_PATH_APPEND) + 20);
sprintf (mib_path, "MIBDIRS=%s\\%s", get_datafile_dir(), MIB_PATH_APPEND);
/* Amazingly enough, Windows does not provide setenv(). */
if (getenv("MIBDIRS") == NULL)
_putenv(mib_path);
g_free(mib_path);
# endif /* HAVE_UCD_SNMP */
#endif /* WIN32 */
/* Notify all registered modules that have had any of their preferences