Ethereal-dev: [Ethereal-dev] A few patches

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Laurent Rabret" <laurent_rabret@xxxxxxxxxxx>
Date: Wed, 20 Oct 2004 23:03:48 +0200
Hi,
Please find attached a few patches to:
- enable Windows' ShellExecute command to call Ethereal without specifying the installation path (a new key added in the registry)
- decode 2 more options in the OPSI plugin.
Thanks to check in and sorry to use this unregistered eMail account :-<<
Regards
Laurent 
 


Express yourself instantly with MSN Messenger! MSN Messenger Download today it's FREE!
Index: packet-opsi.c
===================================================================
--- packet-opsi.c	(revision 12361)
+++ packet-opsi.c	(working copy)
@@ -95,6 +95,8 @@
static int hf_smc_id_att		= -1;
static int hf_smc_receive_time_att	= -1;
static int hf_smc_stat_time_att		= -1;
+static int hf_opsi_flags_att		= -1;
+static int hf_opsi_application_name_att	= -1;

/* Initialize the subtree pointers */
static gint ett_opsi 			= -1;
@@ -131,6 +133,8 @@
static gint ett_opsi_smc_id		= -1;
static gint ett_opsi_smc_receive_time	= -1;
static gint ett_opsi_smc_stat_time	= -1;
+static gint ett_opsi_flags		= -1;
+static gint ett_opsi_application_name	= -1;


/* Code mapping */
@@ -327,6 +331,11 @@
"SMC receive time attribute", &ett_opsi_smc_receive_time, &hf_smc_receive_time_att, decode_time_attribute },
	{SMC_STAT_TIME_ATTRIBUTE,	/* 661 */
"SMC stat time attribute", &ett_opsi_smc_stat_time, &hf_smc_stat_time_att, decode_longint_attribute },
+	{OPSI_FLAGS_ATTRIBUTE,		/* 674 */
+ "OPSI flags attribute", &ett_opsi_flags, &hf_opsi_flags_att, decode_longint_attribute },
+	{OPSI_APPLICATION_NAME_ATTRIBUTE,/* 675 */
+ "OPSI application name attribute", &ett_opsi_application_name, &hf_opsi_application_name_att, decode_string_attribute },
+
};
#define OPSI_ATTRIBUTES_COUNT (sizeof(opsi_attributes)/sizeof(opsi_attribute_handle_t))

@@ -713,6 +722,16 @@
			FT_UINT32, BASE_DEC, NULL, 0x00,
			"", HFILL }
		},
+		{ &hf_opsi_flags_att,
+			{ "OPSI flags",			"opsi.attr.flags",
+			FT_UINT32, BASE_DEC, NULL, 0x00,
+			"", HFILL }
+		},
+		{ &hf_opsi_application_name_att,
+			{ "OPSI application name",	"opsi.attr.application_name",
+			FT_STRING, BASE_NONE, NULL, 0x00,
+			"", HFILL }
+		},
	};

/* Setup protocol subtree array */
@@ -751,6 +770,8 @@
		&ett_opsi_smc_id,
		&ett_opsi_smc_receive_time,
		&ett_opsi_smc_stat_time,
+		&ett_opsi_flags,
+		&ett_opsi_application_name,
	};

/* For desegmentation / reassembly */

Index: packet-opsi.h
===================================================================
--- packet-opsi.h	(revision 12361)
+++ packet-opsi.h	(working copy)
@@ -113,7 +113,10 @@
#define SMC_RECEIVE_TIME_ATTRIBUTE	660
#define SMC_STAT_TIME_ATTRIBUTE		661

+#define OPSI_FLAGS_ATTRIBUTE		674
+#define OPSI_APPLICATION_NAME_ATTRIBUTE	675

+
/*
 * Published API functions.  NOTE, "local" API functions
 * only valid from the packet-opsi file.

Index: ethereal.nsi
===================================================================
--- ethereal.nsi	(revision 12361)
+++ ethereal.nsi	(working copy)
@@ -302,6 +302,11 @@
WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ethereal" "NoModify" 1 WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ethereal" "NoRepair" 1
WriteUninstaller "uninstall.exe"
+
+; Write an entry for ShellExecute
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\ethereal.exe" "" '$INSTDIR\ethereal.exe' +WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\ethereal.exe" "Path" '$INSTDIR'
+
SectionEnd

!ifdef GTK1_DIR
@@ -544,7 +549,8 @@
NoEtherealErrorMsg:

DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ethereal"
-DeleteRegKey HKEY_LOCAL_MACHINE SOFTWARE\Ethereal
+DeleteRegKey HKEY_LOCAL_MACHINE "Software\Ethereal"
+DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\ethereal.exe"

push $R0
	StrCpy $R0 ".5vw"