Wireshark

  • Riverbed Technology
  • WinPcap
the world's foremost network protocol analyzer
  • Wireshark
    • About
    • Download
    • Blog
  • Get Help
    • Ask a Question
    • FAQs
    • Documentation
    • Mailing Lists
    • Online Tools
    • Wiki
    • Bug Tracker
  • Develop
    • Get Involved
    • Developer's Guide
    • Browse the Code
    • Latest Builds

Wireshark-dev: [Wireshark-dev] [Patch] update to packet-newmail.c

Date Index Thread Index Other Months All Mailing Lists
Date Prev Date Next Thread Prev Thread Next


From: Stephen Fisher <stephentfisher@xxxxxxxxx>
Date: Mon, 2 Oct 2006 16:23:45 -0700

Attached is a patch that changes packet-newmail.c to always register 
itself on the port from the preferences (defaults to 0) upon launch.  
This allows the user to right-click and use decode as.  Currently, the 
dissector only registers itself when the default port number changes 
from 0 or by packet-dcerpc-mapi.c when a MAPI register push notification 
packet is seen.


Thanks,
  Steve
Index: epan/dissectors/packet-newmail.c
===================================================================
--- epan/dissectors/packet-newmail.c	(revision 19398)
+++ epan/dissectors/packet-newmail.c	(working copy)
@@ -46,8 +46,8 @@
 void proto_reg_handoff_newmail(void);
 
 /* Variables for preferences */
-guint preference_default_port = 0;
-guint preference_default_port_last = 0;
+guint preference_default_port;
+guint preference_default_port_last;
 
 /* Initialize the protocol and registered fields */
 static int proto_newmail = -1;
@@ -128,9 +128,17 @@
 void
 proto_reg_handoff_newmail(void)
 {
+	static gboolean inited = FALSE;
+
 	dissector_handle_t newmail_handle;
 
 	newmail_handle = find_dissector("newmail");
+
+	if(!inited) {
+		dissector_add("udp.port", preference_default_port, newmail_handle);
+		preference_default_port_last = preference_default_port;
+		inited = TRUE;
+	}
 	
 	if(preference_default_port != preference_default_port_last) {	
 		/* Unregister the last setting */
  • Follow-Ups:
    • Re: [Wireshark-dev] [Patch] update to packet-newmail.c
      • From: Anders Broman
    • Re: [Wireshark-dev] [Patch] update to packet-newmail.c
      • From: Anders Broman
    • Re: [Wireshark-dev] [Patch] update to packet-newmail.c
      • From: ronnie sahlberg
  • Prev by Date: Re: [Wireshark-dev] [Wireshark-commits] rev 19372: /trunk/ /trunk/: Makefile.nmake
  • Next by Date: [Wireshark-dev] Fwd: Patch for packet-vnc.c
  • Previous by thread: Re: [Wireshark-dev] call to cf_read(&cfile) corrupts stack
  • Next by thread: Re: [Wireshark-dev] [Patch] update to packet-newmail.c
  • Index(es):
    • Date
    • Thread

Wireshark and the "fin" logo are registered trademarks of the Wireshark Foundation