When registering a string preference, if the value of the preference is
[obnox/wireshark/wip.git] / packet-giop.h
index 48368df1824e188a03f381d4898b839b02e2b72f..ad4d67eaee9572acac6ac096a91724f6dcb0d737 100644 (file)
@@ -1,25 +1,25 @@
 /* packet-giop.h
- * Declarations of outines for GIOP (CDR) dissection
+ * Declaration of routines for GIOP/IIOP (CDR) dissection
  * Copyright 2000, Frank Singleton <frank.singleton@ericsson.com>
  *
  * Based on CORBAv2.4.2  Chapter 15 GIOP Description.
  *
- * $Id: packet-giop.h,v 1.5 2001/06/29 20:49:29 guy Exp $
+ * $Id: packet-giop.h,v 1.10 2002/08/28 21:00:13 jmayer Exp $
  *
  * Ethereal - Network traffic analyzer
  * 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
  * 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.
@@ -40,7 +40,7 @@ typedef struct Version {
 } Version;
 
 
-/* 
+/*
  * Useful data collected from message header. Note, this
  * struct encapsulates useful data from GIOP header, as well
  * as request_id and reply_status for use by sub dissectors.
@@ -58,7 +58,7 @@ typedef struct MessageHeader {
   guint32 req_id;               /* request id in MSG  */
 
   /* MSG dependant data */
-  
+
   guint32 rep_status;           /* reply status in MSG if available */
   gchar *exception_id;             /* exception string if a USER EXCEPTION occurs  */
 
@@ -111,21 +111,22 @@ typedef struct giop_sub_handle {
 
 /* Main GIOP entry point */
 
-gboolean dissect_giop(tvbuff_t *, packet_info *, proto_tree *); /* new interface */
+extern gboolean dissect_giop(tvbuff_t *, packet_info *, proto_tree *); /* new interface */
 
 /*
  * GIOP Users register interest via this function.
  * This is for heuristic dissection
  */
 
-void register_giop_user(giop_sub_dissector_t *sub, gchar *name, int sub_proto);
+extern void register_giop_user(giop_sub_dissector_t *sub, gchar *name,
+    int sub_proto);
 
 /*
  * GIOP Users remove interest via this function.
  * This is for heuristic dissection
  */
 
-void delete_giop_user(giop_sub_dissector_t *sub, gchar *name);
+extern void delete_giop_user(giop_sub_dissector_t *sub, gchar *name);
 
 
 /*
@@ -133,14 +134,16 @@ void delete_giop_user(giop_sub_dissector_t *sub, gchar *name);
  * This is for explicit dissection.
  */
 
-void register_giop_user_module(giop_sub_dissector_t *sub, gchar *name, gchar *module, int sub_proto);
+extern void register_giop_user_module(giop_sub_dissector_t *sub, gchar *name,
+    gchar *module, int sub_proto);
 
 /*
  * GIOP Users remove their module and interface names via this function.
  * This is for explicit dissection.
  */
 
-void delete_giop_user_module(giop_sub_dissector_t *sub, gchar *name, gchar *module);
+extern void delete_giop_user_module(giop_sub_dissector_t *sub, gchar *name,
+    gchar *module);
 
 
 /*
@@ -166,35 +169,35 @@ void delete_giop_user_module(giop_sub_dissector_t *sub, gchar *name, gchar *modu
  * Data is added to tree directly if present.
  */
 
-void get_CDR_any(tvbuff_t *tvb, proto_tree *tree, gint *offset, gboolean stream_is_big_endian,
-                int boundary, MessageHeader * header );
+extern void get_CDR_any(tvbuff_t *tvb, proto_tree *tree, gint *offset,
+    gboolean stream_is_big_endian, int boundary, MessageHeader * header );
 
 
-/* Copy a 1 octet sequence from the tvbuff 
+/* Copy a 1 octet sequence from the tvbuff
  * which represents a boolean value, and convert
  * it to a boolean value.
  * Offset is then incremented by 1, to indicate the 1 octet which
  * has been processed.
  */
 
-gboolean get_CDR_boolean(tvbuff_t *tvb, int *offset);
+extern gboolean get_CDR_boolean(tvbuff_t *tvb, int *offset);
 
 
-/* Copy a 1 octet sequence from the tvbuff 
+/* Copy a 1 octet sequence from the tvbuff
  * which represents a char, and convert
  * it to an char value.
  * offset is then incremented by 1, to indicate the 1 octet which
  * has been processed.
  */
 
-guint8 get_CDR_char(tvbuff_t *tvb, int *offset);
+extern guint8 get_CDR_char(tvbuff_t *tvb, int *offset);
 
 
 
-/* 
- * Floating Point Data Type double IEEE 754-1985 
+/*
+ * Floating Point Data Type double IEEE 754-1985
  *
- * Copy an 8 octet sequence from the tvbuff 
+ * Copy an 8 octet sequence from the tvbuff
  * which represents a double value, and convert
  * it to a double value, taking into account byte order.
  * offset is first incremented so that it falls on a proper alignment
@@ -203,10 +206,11 @@ guint8 get_CDR_char(tvbuff_t *tvb, int *offset);
  * have been processed.
  */
 
-gdouble get_CDR_double(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, int boundary);
+extern gdouble get_CDR_double(tvbuff_t *tvb, int *offset,
+    gboolean stream_is_big_endian, int boundary);
 
 
-/* Copy a 4 octet sequence from the tvbuff 
+/* Copy a 4 octet sequence from the tvbuff
  * which represents an enum value, and convert
  * it to an enum value, taking into account byte order.
  * offset is first incremented so that it falls on a proper alignment
@@ -217,7 +221,8 @@ gdouble get_CDR_double(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian
  * Enum values are encoded as unsigned long.
  */
 
-guint32 get_CDR_enum(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, int boundary);
+extern guint32 get_CDR_enum(tvbuff_t *tvb, int *offset,
+    gboolean stream_is_big_endian, int boundary);
 
 
 
@@ -226,13 +231,13 @@ guint32 get_CDR_enum(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian,
  * which represents a Fixed point decimal type, and create a string representing
  * a Fixed point decimal type. There are no alignment restrictions.
  * Size and scale of fixed decimal type is determined by IDL.
- * 
+ *
  * digits - IDL specified number of "digits" for this fixed type
  * scale  - IDL specified "scale" for this fixed type
  *
  *
  * eg: typedef fixed <5,2> fixed_t;
- *     could represent numbers like 123.45, 789.12, 
+ *     could represent numbers like 123.45, 789.12,
  *
  *
  * As the fixed type could be any size, I will not try to fit it into our
@@ -240,7 +245,7 @@ guint32 get_CDR_enum(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian,
  * a  representation (after scale is applied), and with a decimal point or zero padding
  * inserted at the right place if necessary. The string is null terminated
  *
- * so string may look like 
+ * so string may look like
  *
  *
  *  "+1.234" or "-3456.78" or "1234567309475760377365465897891" or "-2789000000" etc
@@ -253,14 +258,15 @@ guint32 get_CDR_enum(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian,
  *
  */
 
-void get_CDR_fixed(tvbuff_t *tvb, gchar **seq, gint *offset, guint32 digits, gint32 scale);
+extern void get_CDR_fixed(tvbuff_t *tvb, gchar **seq, gint *offset,
+    guint32 digits, gint32 scale);
 
 
 
 /*
- * Floating Point Data Type float IEEE 754-1985 
- * 
- * Copy a 4 octet sequence from the tvbuff 
+ * Floating Point Data Type float IEEE 754-1985
+ *
+ * Copy a 4 octet sequence from the tvbuff
  * which represents a float value, and convert
  * it to a float value, taking into account byte order.
  * offset is first incremented so that it falls on a proper alignment
@@ -269,18 +275,19 @@ void get_CDR_fixed(tvbuff_t *tvb, gchar **seq, gint *offset, guint32 digits, gin
  * have been processed.
  */
 
-gfloat get_CDR_float(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, int boundary);
+extern gfloat get_CDR_float(tvbuff_t *tvb, int *offset,
+    gboolean stream_is_big_endian, int boundary);
 
 
 /*
  * Decode an Interface type, and display it on the tree.
  */
 
-void get_CDR_interface(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset, 
-                      gboolean stream_is_big_endian, int boundary);
+extern void get_CDR_interface(tvbuff_t *tvb, packet_info *pinfo,
+    proto_tree *tree, int *offset, gboolean stream_is_big_endian, int boundary);
 
 
-/* Copy a 4 octet sequence from the tvbuff 
+/* Copy a 4 octet sequence from the tvbuff
  * which represents a signed long value, and convert
  * it to an signed long vaule, taking into account byte order.
  * offset is first incremented so that it falls on a proper alignment
@@ -289,11 +296,12 @@ void get_CDR_interface(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
  * have been processed.
  */
 
-gint32 get_CDR_long(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, int boundary);
+extern gint32 get_CDR_long(tvbuff_t *tvb, int *offset,
+    gboolean stream_is_big_endian, int boundary);
 
 
 
-/* Copy a 16 octet sequence from the tvbuff 
+/* Copy a 16 octet sequence from the tvbuff
  * which represents a long double value, and convert
  * it to a long double value, taking into account byte order.
  * offset is first incremented so that it falls on a proper alignment
@@ -304,19 +312,19 @@ gint32 get_CDR_long(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, i
 
 #ifdef G_HAVE_GLONG_DOUBLE
 
-glong_double get_CDR_long_double(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, 
-                                int boundary);
+extern glong_double get_CDR_long_double(tvbuff_t *tvb, int *offset,
+    gboolean stream_is_big_endian, int boundary);
 #else
 
 /* FIX -- Cast long double to gdouble until I figure this out -- FS*/
 
-gdouble get_CDR_long_double(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, 
-                                int boundary);
+extern gdouble get_CDR_long_double(tvbuff_t *tvb, int *offset,
+    gboolean stream_is_big_endian, int boundary);
 
 #endif
 
 
-/* Copy an 8 octet sequence from the tvbuff 
+/* Copy an 8 octet sequence from the tvbuff
  * which represents a signed long long value, and convert
  * it to a signed long long value, taking into account byte order.
  * offset is first incremented so that it falls on a proper alignment
@@ -326,36 +334,37 @@ gdouble get_CDR_long_double(tvbuff_t *tvb, int *offset, gboolean stream_is_big_e
  */
 
 #ifdef G_HAVE_GINT64
-gint64 get_CDR_long_long(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, int boundary);
+extern gint64 get_CDR_long_long(tvbuff_t *tvb, int *offset,
+    gboolean stream_is_big_endian, int boundary);
 #endif
 
 /*
  * Decode an Object type, and display it on the tree.
  */
 
-void get_CDR_object(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset, 
-                      gboolean stream_is_big_endian, int boundary);
+extern void get_CDR_object(tvbuff_t *tvb, packet_info *pinfo,
+    proto_tree *tree, int *offset, gboolean stream_is_big_endian, int boundary);
 
 
-/* Copy a 1 octet sequence from the tvbuff 
+/* Copy a 1 octet sequence from the tvbuff
  * which represents a octet, and convert
  * it to an octet value.
  * offset is then incremented by 1, to indicate the 1 octet which
  * has been processed.
  */
 
-guint8 get_CDR_octet(tvbuff_t *tvb, int *offset);
+extern guint8 get_CDR_octet(tvbuff_t *tvb, int *offset);
 
 
 /* Copy a sequence of octets from the tvbuff.
- * Caller of this function must remember to free the 
+ * Caller of this function must remember to free the
  * array pointed to by seq.
- * This function also increments offset by len. 
+ * This function also increments offset by len.
  */
 
-void get_CDR_octet_seq(tvbuff_t *tvb, gchar **seq, int *offset, int len);
+extern void get_CDR_octet_seq(tvbuff_t *tvb, gchar **seq, int *offset, guint32 len);
 
-/* Copy a 2 octet sequence from the tvbuff 
+/* Copy a 2 octet sequence from the tvbuff
  * which represents a signed short value, and convert
  * it to a signed short value, taking into account byte order.
  * offset is first incremented so that it falls on a proper alignment
@@ -364,10 +373,11 @@ void get_CDR_octet_seq(tvbuff_t *tvb, gchar **seq, int *offset, int len);
  * have been processed.
  */
 
-gint16 get_CDR_short(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, int boundary);
+extern gint16 get_CDR_short(tvbuff_t *tvb, int *offset,
+    gboolean stream_is_big_endian, int boundary);
 
 
-/* Copy an octet sequence from the tvbuff 
+/* Copy an octet sequence from the tvbuff
  * which represents a string, and convert
  * it to an string value, taking into account byte order.
  * offset is first incremented so that it falls on a proper alignment
@@ -385,25 +395,25 @@ gint16 get_CDR_short(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian,
  *
  */
 
-guint32 get_CDR_string(tvbuff_t *tvb, gchar **seq, int *offset, gboolean stream_is_big_endian,
-                      int boundary);
+extern guint32 get_CDR_string(tvbuff_t *tvb, gchar **seq, int *offset,
+    gboolean stream_is_big_endian, int boundary);
 
 
-/* Process a sequence of octets that represent the 
+/* Process a sequence of octets that represent the
  * Pseudo Object Type "TypeCode". Typecodes are used for example,
- * by "Any values". 
+ * by "Any values".
  * This function also increments offset to the correct position.
  *
  * It will parse the TypeCode and output data to the "tree" provided
  * by the user
  *
- * It returns a guint32 representing a TCKind value. 
+ * It returns a guint32 representing a TCKind value.
  */
 
-guint32 get_CDR_typeCode(tvbuff_t *tvb, proto_tree *tree, gint *offset, gboolean stream_is_big_endian,
-                        int boundary, MessageHeader * header );
+extern guint32 get_CDR_typeCode(tvbuff_t *tvb, proto_tree *tree, gint *offset,
+    gboolean stream_is_big_endian, int boundary, MessageHeader * header );
 
-/* Copy a 4 octet sequence from the tvbuff 
+/* Copy a 4 octet sequence from the tvbuff
  * which represents an unsigned long value, and convert
  * it to an unsigned long value, taking into account byte order.
  * offset is first incremented so that it falls on a proper alignment
@@ -412,10 +422,11 @@ guint32 get_CDR_typeCode(tvbuff_t *tvb, proto_tree *tree, gint *offset, gboolean
  * have been processed.
  */
 
-guint32 get_CDR_ulong(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, int boundary);
+extern guint32 get_CDR_ulong(tvbuff_t *tvb, int *offset,
+    gboolean stream_is_big_endian, int boundary);
 
 
-/* Copy an 8 octet sequence from the tvbuff 
+/* Copy an 8 octet sequence from the tvbuff
  * which represents an unsigned long long value, and convert
  * it to an unsigned long long value, taking into account byte order.
  * offset is first incremented so that it falls on a proper alignment
@@ -425,11 +436,12 @@ guint32 get_CDR_ulong(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian,
  */
 
 #ifdef G_HAVE_GINT64
-guint64 get_CDR_ulong_long(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, int boundary);
+extern guint64 get_CDR_ulong_long(tvbuff_t *tvb, int *offset,
+    gboolean stream_is_big_endian, int boundary);
 #endif
 
 
-/* Copy a 2 octet sequence from the tvbuff 
+/* Copy a 2 octet sequence from the tvbuff
  * which represents an unsigned short value, and convert
  * it to an unsigned short value, taking into account byte order.
  * offset is first incremented so that it falls on a proper alignment
@@ -438,11 +450,12 @@ guint64 get_CDR_ulong_long(tvbuff_t *tvb, int *offset, gboolean stream_is_big_en
  * have been processed.
  */
 
-guint16 get_CDR_ushort(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, int boundary);
+extern guint16 get_CDR_ushort(tvbuff_t *tvb, int *offset,
+    gboolean stream_is_big_endian, int boundary);
 
 
 /* Copy a wchar from the tvbuff.
- * Caller of this function must remember to free the 
+ * Caller of this function must remember to free the
  * array pointed to by seq.
  * This function also increments offset according to
  * the wchar size.
@@ -462,7 +475,7 @@ guint16 get_CDR_ushort(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian
 /* NOTE: This is very primitive in that it just reads
  * the wchar as a series of octets and returns them
  * to the user. No translation is attempted based on
- * byte orientation, nor on code set. I.e it only 
+ * byte orientation, nor on code set. I.e it only
  * really reads past the wchar and increments the offset
  * by the length of the octet sequence.
  */
@@ -471,11 +484,12 @@ guint16 get_CDR_ushort(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian
  * Wchar is not supported for GIOP 1.0.
  */
 
-gint8 get_CDR_wchar(tvbuff_t *tvb, gchar **seq, int *offset, MessageHeader * header);
+extern gint get_CDR_wchar(tvbuff_t *tvb, gchar **seq, int *offset,
+    MessageHeader * header);
 
 
 /* Copy a wstring from the tvbuff.
- * Caller of this function must remember to free the 
+ * Caller of this function must remember to free the
  * array pointed to by seq.
  * This function also increments offset, according to
  * wstring length. length is returned as guint32
@@ -484,7 +498,7 @@ gint8 get_CDR_wchar(tvbuff_t *tvb, gchar **seq, int *offset, MessageHeader * hea
 /* NOTE: This is very primitive in that it just reads
  * the wstring as a series of octets and returns them
  * to the user. No translation is attempted based on
- * byte orientation, nor on code set. I.e it only 
+ * byte orientation, nor on code set. I.e it only
  * really reads past the wstring and increments the offset
  * by the length of the octet sequence.
  */
@@ -493,8 +507,8 @@ gint8 get_CDR_wchar(tvbuff_t *tvb, gchar **seq, int *offset, MessageHeader * hea
  * Wstring is not supported for GIOP 1.0.
  */
 
-guint32 get_CDR_wstring(tvbuff_t *tvb, gchar **seq, int *offset, gboolean stream_is_big_endian, 
-                       int boundary, MessageHeader * header);
+extern guint32 get_CDR_wstring(tvbuff_t *tvb, gchar **seq, int *offset,
+    gboolean stream_is_big_endian, int boundary, MessageHeader * header);
 
 
 
@@ -508,7 +522,7 @@ guint32 get_CDR_wstring(tvbuff_t *tvb, gchar **seq, int *offset, gboolean stream
 
 /* Determine the byte order from the GIOP MessageHeader */
 
-gboolean is_big_endian (MessageHeader * header);
+extern gboolean is_big_endian (MessageHeader * header);
 
 /*
  * get_encap_info() for any encapsulation  (eg:sequences)
@@ -516,7 +530,7 @@ gboolean is_big_endian (MessageHeader * header);
  * and *offset, and returns the sequence length.
  */
 
-guint32 get_CDR_encap_info(tvbuff_t *tvb, proto_tree *tree, gint *offset, 
+extern guint32 get_CDR_encap_info(tvbuff_t *tvb, proto_tree *tree, gint *offset,
                           gboolean old_stream_is_big_endian, guint32 old_boundary,
                           gboolean *new_stream_is_big_endian_ptr, guint32 *new_boundary_ptr );