On Mon, 8 Aug 2005, Thomas Anders wrote:
> Jaap Keuter wrote:
> > Shouldn't the SNMP dissector substitute the colon by a semicolon on the
> > Win32 platform so that the translations work and a save fixes the
> > preferences file?
>
> There's a related comment in epan/dissectors/packet-snmp.c saying
>
> /* Default MIB modules to load */
> /*
> * XXX - Should we try to be clever and replace colons for semicolons under
> * Windows and the converse on non-Windows systems?
> */
>
> It looks like just noone has found the time/motivation to implement this
> yet. Patches appreciated. :-)
Ok, had some time to look into it. This is what I found:
Index: packet-snmp.c
===================================================================
--- packet-snmp.c (revision 15287)
+++ packet-snmp.c (working copy)
@@ -122,10 +122,6 @@
static int proto_snmp = -1;
/* Default MIB modules to load */
-/*
- * XXX - Should we try to be clever and replace colons for semicolons under
- * Windows and the converse on non-Windows systems?
- */
#ifdef _WIN32
# define DEF_MIB_MODULES "IP-MIB;IF-MIB;TCP-MIB;UDP-MIB;SNMPv2-MIB;RFC1213-MIB;UCD-SNMP-MIB"
#else
@@ -2588,6 +2584,12 @@
tmp_mib_modules = g_strconcat("MIBS=", mib_modules, NULL);
#ifdef _WIN32
+ /*
+ * If an old preferences file or, at the first run, an incorrect
+ * environment variable was read "mib_modules" can contain
+ * colon seperated entries.
+ */
+ g_strdelimit(tmp_mib_modules, ":", ';');
_putenv(tmp_mib_modules);
#else
putenv(tmp_mib_modules);
===================================================================
Well now, that wasn't too difficult was it :-)) I've checked it on Win32
0.10.11 and works fine. We can leave the tooltip in to encourage proper
form.
Ehh, there's no malloc/free issue with this patch. The rest of the code is
a different matter....
Thanx,
Jaap