/* 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.4 2001/06/27 20:38:56 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.
} 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.
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 */
typedef struct giop_sub_handle {
giop_sub_dissector_t *sub_fn; /* ptr to sub dissector function */
gchar *sub_name; /* subdissector string name */
-
+ int sub_proto; /* proto_XXX value from proto_register_protocol() */
} giop_sub_handle_t;
/* 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);
+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);
/*
* This is for explicit dissection.
*/
-void register_giop_user_module(giop_sub_dissector_t *sub, gchar *name, gchar *module);
+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);
/*
* 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
* 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
* 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);
* 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
* 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
*
*/
-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
* 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
* 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
#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
*/
#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
* 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
*
*/
-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
* 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
*/
#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
* 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.
/* 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.
*/
* 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
/* 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.
*/
* 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);
/* 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)
* 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 );