Ethereal-dev: [Ethereal-dev] idl2eth patch

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

From: Frank Singleton <frank.singleton@xxxxxxxxxxxx>
Date: Tue, 17 Jul 2001 09:52:37 -0500
Hi,

Here is a small patch to use the name of the main
IDL file as the name of the giop subdissector,
rather than "TEST".

It was diffed against  ethereal-2001-07-17 nightly
tarball.

/Frank

-- 
EUS/SV/Z Frank Singleton      ASO Americas BSS
Office : +1 972 583 3251      ECN 800 33251  
Mobile : +1 214 228 0874      Amateur Radio: VK3FCS/KM5WS   
Email : frank.singleton@xxxxxxxxxxxx

Hardware: HP Omnibook 4150 running Redhat Linux 7.1 (2.4.3-12 kernel).
--- ../ethereal-2001-07-17/ethereal_be.py	Mon Jun 18 00:27:16 2001
+++ ../ethereal-2001-07-17.updated/ethereal_be.py	Tue Jul 17 08:41:36 2001
@@ -1,6 +1,6 @@
 # -*- python -*-
 #
-# $Id: ethereal_be.py,v 1.1 2001/06/18 05:27:16 guy Exp $
+# $Id: ethereal_be.py,v 1.2 2001/07/17 13:23:10 frank Exp $
 #
 #    File      : ethereal_be.py
 #
@@ -123,11 +123,20 @@
     ev = EtherealVisitor(st)            # create visitor object
     
     ev.visitAST(tree)                   # go find some operations
+    
+    #
+    # Grab name of main IDL file being compiled.
+    # 
+    # Assumption: Name is of the form   abcdefg.xyz  (eg: CosNaming.idl)
+    #
+
+    nl = string.split(tree.file(),".")[0] # split name of main IDL file using "." as separator
+                                          # and grab first field (eg: CosNaming)
 
     # create a C generator object
     # and generate some C code
-
-    eg = ethereal_gen_C(ev.st, "TEST", "test", "Test Dissector Using GIOP API") 
+    
+    eg = ethereal_gen_C(ev.st, string.upper(nl), string.lower(nl), string.capitalize(nl) + " Dissector Using GIOP API") 
     eg.genCode(ev.oplist)               # pass them onto the C generator