New tap for tethereal: io statistics that provides frames/bytes counts for frames...
[obnox/wireshark/wip.git] / packet-fw1.c
index 6b232c186f5a5bb60cf501467fbbb656a7a9739d..b1a0fa6f62b67b52af6782e8fc098e2afde3e57e 100644 (file)
@@ -2,12 +2,12 @@
  * Routines for Ethernet header disassembly of FW1 "monitor" files
  * Copyright 2002, Alfred Koebler <ak@icon-sult.de>
  *
- * $Id: packet-fw1.c,v 1.3 2002/08/08 21:42:05 jmayer Exp $
+ * $Id: packet-fw1.c,v 1.5 2002/08/28 21:00:13 jmayer Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Alfred Koebler <ak@icon-sult.de>
  * Copyright 2002 I.Consult
- * 
+ *
  * To use this dissector use the command line option
  * -o eth.interpret_as_fw1_monitor:TRUE
  *
@@ -46,8 +46,8 @@
  * For the four lines in the Top Pane you will see the according lines
  * in the Middle Pane:
  *   El90x1 o
- * O El90x1 
- * i El90x1 
+ * O El90x1
+ * i El90x1
  *   El90x1 I
  *
  * Example for a packet traversing through the Firewall, first through
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
  * of the License, or (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
@@ -105,10 +105,10 @@ static void
 dissect_fw1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
   /* Set up structures needed to add the protocol subtree and manage it */
-  proto_item    *ti; 
+  proto_item    *ti;
   proto_tree    *volatile fh_tree = NULL;
   char         direction[3];
-  char         interface[20];
+  char         interface_name[20];
   guint16      etype;
   char         header[1000];
   char         *p_header;
@@ -133,24 +133,24 @@ dissect_fw1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     /* fetch info to local variable */
     direction[0] = tvb_get_guint8(tvb, 0);
     direction[1] = 0;
-    tvb_get_nstringz0(tvb, 2, 10, interface);
+    tvb_get_nstringz0(tvb, 2, 10, interface_name);
 
     if (fw1_summary_in_tree) {
       /* Known interface name - if not, remember it */
       found=1;
       for (i=0; i<interface_anzahl && i<MAX_INTERFACES; i++) {
-        if ( strcmp(p_interfaces[i], interface) == 0 ) {
+        if ( strcmp(p_interfaces[i], interface_name) == 0 ) {
           found=0;
         }
       }
       if (found == 1 ) {
-        p_interfaces[interface_anzahl] = strdup(interface);
+        p_interfaces[interface_anzahl] = strdup(interface_name);
         interface_anzahl++;
       }
       /* display all interfaces always in the same order */
       for (i=0; i<interface_anzahl; i++) {
         found=1;
-        if ( strcmp(p_interfaces[i], interface) == 0 ) {
+        if ( strcmp(p_interfaces[i], interface_name) == 0 ) {
           found=0;
         }
         p_header = header + strlen(header);
@@ -169,7 +169,7 @@ dissect_fw1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     }
 
     ti = proto_tree_add_protocol_format(tree, proto_fw1, tvb, 0, ETH_HEADER_SIZE, header);
+
     /* create display subtree for the protocol */
     fh_tree = proto_item_add_subtree(ti, ett_fw1);
 
@@ -177,12 +177,12 @@ dissect_fw1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
     proto_tree_add_string_format(fh_tree, hf_fw1_interface,
        tvb, 2, 10,
-       interface, "Interface: %s", interface);
+       interface_name, "Interface: %s", interface_name);
   }
   ethertype(etype, tvb, ETH_HEADER_SIZE, pinfo, tree, fh_tree, hf_fw1_type,
           hf_fw1_trailer);
 }
-    
+
 void
 proto_register_fw1(void)
 {