Removed trailing whitespaces from .h and .c files using the
[obnox/wireshark/wip.git] / packet-osi-options.c
index 5a16a69afef406d15b5d8ad8cb7f8d32c38717c0..46bba99d42cc57b82c02cd7b5808e735f04a8ded 100644 (file)
@@ -2,16 +2,15 @@
  * Routines for the decode of ISO/OSI option part 
  * Covers:
  * ISO  8473 CLNP (ConnectionLess Mode Network Service Protocol)
- * ISO 10589 ISIS (Intradomain Routeing Information Exchange Protocol)
- * ISO  9542 ESIS (End System To Intermediate System Routeing Exchange Protocol)
+ * ISO 10589 ISIS (Intradomain Routing Information Exchange Protocol)
+ * ISO  9542 ESIS (End System To Intermediate System Routing Exchange Protocol)
  *
- * $Id: packet-osi-options.c,v 1.7 2001/04/23 04:19:40 guy Exp $
+ * $Id: packet-osi-options.c,v 1.13 2002/08/02 23:35:55 jmayer Exp $
  * Ralf Schneider <Ralf.Schneider@t-online.de>
  *
  * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
+ * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
- *
  * 
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * 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.
- *
- *
  */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
 #include <stdio.h>
 #include <string.h>
 #include <glib.h>
-#include "packet.h"
+#include <epan/packet.h>
 #include "nlpid.h"
 #include "packet-osi.h"
 #include "packet-isis.h"
@@ -88,7 +81,7 @@
 
 #define OSI_OPT_RFD_GENERAL         0x00
 #define OSI_OPT_RFD_ADDRESS         0x80
-#define OSI_OPT_RFD_SOURCE_ROUTEING 0x90
+#define OSI_OPT_RFD_SOURCE_ROUTING  0x90
 #define OSI_OPT_RFD_LIFETIME        0xa0
 #define OSI_OPT_RFD_PDU_DISCARDED   0xb0
 #define OSI_OPT_RFD_REASSEMBLY      0xc0
@@ -144,9 +137,9 @@ static const value_string osi_opt_rfd_address[] = {
         { 0,    NULL} };
      
 static const value_string osi_opt_rfd_src_route[] = {
-        { 0x00, "Unspecified source routeing error"},
-        { 0x01, "Syntax error in source routeing field"},
-        { 0x02, "Unknown address in source routeing field"},
+        { 0x00, "Unspecified source routing error"},
+        { 0x01, "Syntax error in source routing field"},
+        { 0x02, "Unknown address in source routing field"},
         { 0x03, "Path not acceptable"},
         { 0,    NULL} };
      
@@ -159,7 +152,7 @@ static const value_string osi_opt_rfd_discarded[] = {
         { 0x00, "Unsupported option not specified"},
         { 0x01, "Unsupported protocol version"},
         { 0x02, "Unsupported security option"},
-        { 0x03, "Unsupported source routeing option"},
+        { 0x03, "Unsupported source routing option"},
         { 0x04, "Unsupported recording of route option"},
         { 0,    NULL} };
      
@@ -168,11 +161,11 @@ static const value_string osi_opt_rfd_reassembly[] = {
         { 0,    NULL} };
      
 
-void
-dissect_option_qos( const u_char type, const u_char sub_type, int offset,
-                    u_char len, tvbuff_t *tvb, proto_tree *tree ) {
+static void
+dissect_option_qos( const guchar type, const guchar sub_type, int offset,
+                    guchar len, tvbuff_t *tvb, proto_tree *tree ) {
 
-  u_char      tmp_type = 0;
+  guchar      tmp_type = 0;
   proto_item *ti;
   proto_tree *osi_qos_tree = NULL;
   
@@ -219,15 +212,15 @@ dissect_option_qos( const u_char type, const u_char sub_type, int offset,
   }
 }
 
-void
-dissect_option_route( u_char parm_type, u_char offset, u_char parm_len, 
+static void
+dissect_option_route( guchar parm_type, guchar offset, guchar parm_len, 
                       tvbuff_t *tvb, proto_tree *tree ) {
 
-  u_char      next_hop = 0;
-  u_char      this_hop = 0;
-  u_char      netl     = 0;
-  u_char      last_hop = 0;
-  u_char      cnt_hops = 0;
+  guchar      next_hop = 0;
+  guchar      this_hop = 0;
+  guchar      netl     = 0;
+  guchar      last_hop = 0;
+  guchar      cnt_hops = 0;
   
   proto_item *ti;
   proto_tree *osi_route_tree = NULL;
@@ -244,8 +237,8 @@ dissect_option_route( u_char parm_type, u_char offset, u_char parm_len,
 
     ti = proto_tree_add_text( tree, tvb, offset + next_hop, netl, 
             "Source Routing: %s   ( Next Hop Highlighted In Data Buffer )",
-            (tvb_get_guint8(tvb, offset) == 0) ? "Partial Source Routeing" :
-                                                 "Complete Source Routeing"  ); 
+            (tvb_get_guint8(tvb, offset) == 0) ? "Partial Source Routing" :
+                                                 "Complete Source Routing"  ); 
   }
   else {
     last_hop = tvb_get_guint8(tvb, offset + 1 );
@@ -255,8 +248,8 @@ dissect_option_route( u_char parm_type, u_char offset, u_char parm_len,
 
     ti = proto_tree_add_text( tree, tvb, offset + next_hop, netl,
             "Record of Route: %s : %s",
-            (tvb_get_guint8(tvb, offset) == 0) ? "Partial Source Routeing" :
-                                                 "Complete Source Routeing" ,
+            (tvb_get_guint8(tvb, offset) == 0) ? "Partial Source Routing" :
+                                                 "Complete Source Routing" ,
             val_to_str( last_hop, osi_opt_route, "Unknown (0x%x" ) );
     if ( 255 == last_hop ) 
       this_hop = parm_len + 1;   /* recording terminated, nothing to show */
@@ -280,14 +273,14 @@ dissect_option_route( u_char parm_type, u_char offset, u_char parm_len,
 
 
 
-void
-dissect_option_rfd( const u_char error, const u_char field, u_char offset,
-                          u_char len, tvbuff_t *tvb, proto_tree *tree ) {
-  u_char error_class = 0;
+static void
+dissect_option_rfd( const guchar error, const guchar field, guchar offset,
+                          guchar len, tvbuff_t *tvb, proto_tree *tree ) {
+  guchar error_class = 0;
   char   *format_string[] = 
              { "Reason for discard {General}        : %s, in field %u",
                "Reason for discard {Address}        : %s, in field %u",
-               "Reason for discard {Source Routeing}: %s, in field %u",
+               "Reason for discard {Source Routing}: %s, in field %u",
                "Reason for discard {Lifetime}       : %s, in field %u",
                "Reason for discard {PDU discarded}  : %s, in field %u",
                "Reason for discard {Reassembly}     : %s, in field %u"
@@ -305,7 +298,7 @@ dissect_option_rfd( const u_char error, const u_char field, u_char offset,
                          val_to_str( error & OSI_OPT_RFD_SUB_MASK,
                                osi_opt_rfd_address, "Unknown (0x%x)"), field );
   }
-  else if ( OSI_OPT_RFD_SOURCE_ROUTEING == error_class ) {
+  else if ( OSI_OPT_RFD_SOURCE_ROUTING == error_class ) {
     proto_tree_add_text( tree, tvb, offset + field, 1, format_string[2],
                          val_to_str( error & OSI_OPT_RFD_SUB_MASK,
                              osi_opt_rfd_src_route, "Unknown (0x%x)"), field );
@@ -341,24 +334,22 @@ dissect_option_rfd( const u_char error, const u_char field, u_char offset,
  *   main esis tree data and call the sub-protocols as needed.
  *
  * Input:
- *   u_char       : PDU type to check if option is allowed or not
- *   u_char       : length of option section 
- *   u_char *     : packet data
+ *   guchar       : length of option section 
+ *   tvbuff_t *   : tvbuff containing packet data
  *   int          : offset into packet where we are (packet_data[offset]== start
  *                  of what we care about)
- *   frame_data * : frame data (whole packet with extra info)
  *   proto_tree * : tree of display data.  May be NULL.
  *
  * Output:
  *   void, but we will add to the proto_tree if it is not NULL.
  */
 void
-dissect_osi_options( u_char pdu_type, u_char opt_len, tvbuff_t *tvb, 
-                     int offset, packet_info *pinfo, proto_tree *tree) {
+dissect_osi_options( guchar opt_len, tvbuff_t *tvb, 
+                     int offset, proto_tree *tree) {
    proto_item *ti;
    proto_tree *osi_option_tree = NULL;
-   u_char      parm_len        = 0;
-   u_char      parm_type       = 0;
+   guchar      parm_len        = 0;
+   guchar      parm_type       = 0;
    guint8      octet;
 
    if (tree) {