summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-giop.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:26 +0000
commitc4e8a3222648fcf22ca207f1815ebbf7cd144eeb (patch)
tree93d5c6aa93d9987680dd1adad5685e2ad698f223 /epan/dissectors/packet-giop.h
parentAdding upstream version 4.2.6. (diff)
downloadwireshark-upstream.tar.xz
wireshark-upstream.zip
Adding upstream version 4.4.0.upstream/4.4.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/packet-giop.h')
-rw-r--r--epan/dissectors/packet-giop.h164
1 files changed, 76 insertions, 88 deletions
diff --git a/epan/dissectors/packet-giop.h b/epan/dissectors/packet-giop.h
index 7b07e112..c3160836 100644
--- a/epan/dissectors/packet-giop.h
+++ b/epan/dissectors/packet-giop.h
@@ -24,8 +24,8 @@
#define GIOP_MAGIC_NUMBER 0x47494F50 /* "GIOP" */
typedef struct Version {
- guint8 major;
- guint8 minor;
+ uint8_t major;
+ uint8_t minor;
} Version;
@@ -39,17 +39,17 @@ typedef struct MessageHeader {
/* Common Data */
- guint8 magic[4];
+ uint8_t magic[4];
Version GIOP_version;
- guint8 flags; /* byte_order in 1.0 */
- guint8 message_type;
- guint32 message_size;
+ uint8_t flags; /* byte_order in 1.0 */
+ uint8_t message_type;
+ uint32_t message_size;
/* MSG dependent data */
- guint32 req_id; /* request id in MSG */
- guint32 rep_status; /* reply status in MSG if available */
- gchar *exception_id; /* exception string if a USER EXCEPTION occurs */
+ uint32_t req_id; /* request id in MSG */
+ uint32_t rep_status; /* reply status in MSG if available */
+ char *exception_id; /* exception string if a USER EXCEPTION occurs */
} MessageHeader;
@@ -85,8 +85,8 @@ typedef enum ReplyStatusType {
* Prototype for sub dissector function calls.
*/
-typedef gboolean (giop_sub_dissector_t)(tvbuff_t *, packet_info *, proto_tree *, int *,
- MessageHeader *, const gchar * , gchar *);
+typedef bool (giop_sub_dissector_t)(tvbuff_t *, packet_info *, proto_tree *, int *,
+ MessageHeader *, const char * , char *);
/*
* Generic Subdissector handle, wraps user info.
@@ -94,20 +94,20 @@ typedef gboolean (giop_sub_dissector_t)(tvbuff_t *, packet_info *, proto_tree *,
typedef struct giop_sub_handle {
giop_sub_dissector_t *sub_fn; /* ptr to sub dissector function */
- const gchar *sub_name; /* subdissector string name */
+ const char *sub_name; /* subdissector string name */
protocol_t *sub_proto; /* protocol_t for subprotocol */
} giop_sub_handle_t;
/* Main GIOP entry point */
-extern gboolean dissect_giop(tvbuff_t *, packet_info *, proto_tree *); /* new interface */
+extern bool dissect_giop(tvbuff_t *, packet_info *, proto_tree *); /* new interface */
/*
* GIOP Users register interest via this function.
* This is for heuristic dissection
*/
-WS_DLL_PUBLIC void register_giop_user(giop_sub_dissector_t *sub, const gchar *name,
+WS_DLL_PUBLIC void register_giop_user(giop_sub_dissector_t *sub, const char *name,
int sub_proto);
/*
@@ -115,7 +115,7 @@ WS_DLL_PUBLIC void register_giop_user(giop_sub_dissector_t *sub, const gchar *na
* This is for heuristic dissection
*/
-extern void delete_giop_user(giop_sub_dissector_t *sub, gchar *name);
+extern void delete_giop_user(giop_sub_dissector_t *sub, char *name);
/*
@@ -123,16 +123,16 @@ extern void delete_giop_user(giop_sub_dissector_t *sub, gchar *name);
* This is for explicit dissection.
*/
-WS_DLL_PUBLIC void register_giop_user_module(giop_sub_dissector_t *sub, const gchar *name,
- const gchar *module, int sub_proto);
+WS_DLL_PUBLIC void register_giop_user_module(giop_sub_dissector_t *sub, const char *name,
+ const char *module, int sub_proto);
/*
* GIOP Users remove their module and interface names via this function.
* This is for explicit dissection.
*/
-extern 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, char *name,
+ char *module);
/*
@@ -144,7 +144,7 @@ extern void delete_giop_user_module(giop_sub_dissector_t *sub, gchar *name,
* - Pseudo Object Types
*
*
- * Altough some of these look redundant, I have separated them
+ * Although some of these look redundant, I have separated them
* out for all CDR types, to assist in auto generation of
* IDL dissectors later, see idl2wrs -- FS
*
@@ -159,7 +159,7 @@ extern void delete_giop_user_module(giop_sub_dissector_t *sub, gchar *name,
*/
WS_DLL_PUBLIC void get_CDR_any(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item,
- gint *offset, gboolean stream_is_big_endian,
+ int *offset, bool stream_is_big_endian,
int boundary, MessageHeader * header);
@@ -170,7 +170,7 @@ WS_DLL_PUBLIC void get_CDR_any(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
* has been processed.
*/
-WS_DLL_PUBLIC gboolean get_CDR_boolean(tvbuff_t *tvb, int *offset);
+WS_DLL_PUBLIC bool get_CDR_boolean(tvbuff_t *tvb, int *offset);
/* Copy a 1 octet sequence from the tvbuff
@@ -180,7 +180,7 @@ WS_DLL_PUBLIC gboolean get_CDR_boolean(tvbuff_t *tvb, int *offset);
* has been processed.
*/
-WS_DLL_PUBLIC guint8 get_CDR_char(tvbuff_t *tvb, int *offset);
+WS_DLL_PUBLIC uint8_t get_CDR_char(tvbuff_t *tvb, int *offset);
@@ -196,8 +196,8 @@ WS_DLL_PUBLIC guint8 get_CDR_char(tvbuff_t *tvb, int *offset);
* have been processed.
*/
-WS_DLL_PUBLIC gdouble get_CDR_double(tvbuff_t *tvb, int *offset,
- gboolean stream_is_big_endian, int boundary);
+WS_DLL_PUBLIC double get_CDR_double(tvbuff_t *tvb, int *offset,
+ bool stream_is_big_endian, int boundary);
/* Copy a 4 octet sequence from the tvbuff
@@ -211,8 +211,8 @@ WS_DLL_PUBLIC gdouble get_CDR_double(tvbuff_t *tvb, int *offset,
* Enum values are encoded as unsigned long.
*/
-WS_DLL_PUBLIC guint32 get_CDR_enum(tvbuff_t *tvb, int *offset,
- gboolean stream_is_big_endian, int boundary);
+WS_DLL_PUBLIC uint32_t get_CDR_enum(tvbuff_t *tvb, int *offset,
+ bool stream_is_big_endian, int boundary);
@@ -231,7 +231,7 @@ WS_DLL_PUBLIC guint32 get_CDR_enum(tvbuff_t *tvb, int *offset,
*
*
* As the fixed type could be any size, I will not try to fit it into our
- * simple types like gdouble or glong etc. I will just create a string buffer holding
+ * simple types like double or long etc. I will just create a string buffer holding
* 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
*
@@ -247,7 +247,7 @@ WS_DLL_PUBLIC guint32 get_CDR_enum(tvbuff_t *tvb, int *offset,
*/
WS_DLL_PUBLIC void get_CDR_fixed(tvbuff_t *tvb, packet_info *pinfo, proto_item *item,
- gchar **seq, gint *offset, guint32 digits, gint32 scale);
+ char **seq, int *offset, uint32_t digits, int32_t scale);
/*
@@ -262,8 +262,8 @@ WS_DLL_PUBLIC void get_CDR_fixed(tvbuff_t *tvb, packet_info *pinfo, proto_item *
* have been processed.
*/
-WS_DLL_PUBLIC gfloat get_CDR_float(tvbuff_t *tvb, int *offset,
- gboolean stream_is_big_endian, int boundary);
+WS_DLL_PUBLIC float get_CDR_float(tvbuff_t *tvb, int *offset,
+ bool stream_is_big_endian, int boundary);
/*
@@ -271,7 +271,7 @@ WS_DLL_PUBLIC gfloat get_CDR_float(tvbuff_t *tvb, int *offset,
*/
WS_DLL_PUBLIC void get_CDR_interface(tvbuff_t *tvb, packet_info *pinfo,
- proto_tree *tree, int *offset, gboolean stream_is_big_endian, int boundary);
+ proto_tree *tree, int *offset, bool stream_is_big_endian, int boundary);
/* Copy a 4 octet sequence from the tvbuff
@@ -283,8 +283,8 @@ WS_DLL_PUBLIC void get_CDR_interface(tvbuff_t *tvb, packet_info *pinfo,
* have been processed.
*/
-WS_DLL_PUBLIC gint32 get_CDR_long(tvbuff_t *tvb, int *offset,
- gboolean stream_is_big_endian, int boundary);
+WS_DLL_PUBLIC int32_t get_CDR_long(tvbuff_t *tvb, int *offset,
+ bool stream_is_big_endian, int boundary);
@@ -297,18 +297,11 @@ WS_DLL_PUBLIC gint32 get_CDR_long(tvbuff_t *tvb, int *offset,
* have been processed.
*/
-#ifdef G_HAVE_GLONG_DOUBLE
+/* FIX -- Cast long double to double until I figure this out -- FS*/
-WS_DLL_PUBLIC glong_double get_CDR_long_double(tvbuff_t *tvb, int *offset,
- gboolean stream_is_big_endian, int boundary);
-#else
+WS_DLL_PUBLIC double get_CDR_long_double(tvbuff_t *tvb, int *offset,
+ bool stream_is_big_endian, int boundary);
-/* FIX -- Cast long double to gdouble until I figure this out -- FS*/
-
-WS_DLL_PUBLIC 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
@@ -320,15 +313,15 @@ WS_DLL_PUBLIC gdouble get_CDR_long_double(tvbuff_t *tvb, int *offset,
* have been processed.
*/
-WS_DLL_PUBLIC gint64 get_CDR_long_long(tvbuff_t *tvb, int *offset,
- gboolean stream_is_big_endian, int boundary);
+WS_DLL_PUBLIC int64_t get_CDR_long_long(tvbuff_t *tvb, int *offset,
+ bool stream_is_big_endian, int boundary);
/*
* Decode an Object type, and display it on the tree.
*/
WS_DLL_PUBLIC void get_CDR_object(tvbuff_t *tvb, packet_info *pinfo,
- proto_tree *tree, int *offset, gboolean stream_is_big_endian, int boundary);
+ proto_tree *tree, int *offset, bool stream_is_big_endian, int boundary);
/* Copy a 1 octet sequence from the tvbuff
@@ -338,16 +331,14 @@ WS_DLL_PUBLIC void get_CDR_object(tvbuff_t *tvb, packet_info *pinfo,
* has been processed.
*/
-WS_DLL_PUBLIC guint8 get_CDR_octet(tvbuff_t *tvb, int *offset);
+WS_DLL_PUBLIC uint8_t get_CDR_octet(tvbuff_t *tvb, int *offset);
/* Copy a sequence of octets from the tvbuff.
- * Memory is allocated in packet pool and will be
- * automatically freed once the packet dissection is finished.
* This function also increments offset by len.
*/
-WS_DLL_PUBLIC void get_CDR_octet_seq(tvbuff_t *tvb, const guint8 **seq, int *offset, guint32 len);
+WS_DLL_PUBLIC void get_CDR_octet_seq(wmem_allocator_t *scope, tvbuff_t *tvb, const uint8_t **seq, int *offset, uint32_t len);
/* Copy a 2 octet sequence from the tvbuff
* which represents a signed short value, and convert
@@ -358,12 +349,12 @@ WS_DLL_PUBLIC void get_CDR_octet_seq(tvbuff_t *tvb, const guint8 **seq, int *off
* have been processed.
*/
-WS_DLL_PUBLIC gint16 get_CDR_short(tvbuff_t *tvb, int *offset,
- gboolean stream_is_big_endian, int boundary);
+WS_DLL_PUBLIC int16_t get_CDR_short(tvbuff_t *tvb, int *offset,
+ bool stream_is_big_endian, int boundary);
WS_DLL_PUBLIC void giop_add_CDR_string(proto_tree *tree, tvbuff_t *tvb, int *offset,
- gboolean stream_is_big_endian, int boundary,
+ bool stream_is_big_endian, int boundary,
int hf);
/* Copy an octet sequence from the tvbuff
@@ -385,8 +376,8 @@ WS_DLL_PUBLIC void giop_add_CDR_string(proto_tree *tree, tvbuff_t *tvb, int *off
*
*/
-WS_DLL_PUBLIC guint32 get_CDR_string(tvbuff_t *tvb, const gchar **seq, int *offset,
- gboolean stream_is_big_endian, int boundary);
+WS_DLL_PUBLIC uint32_t get_CDR_string(tvbuff_t *tvb, const char **seq, int *offset,
+ bool stream_is_big_endian, int boundary);
/* Process a sequence of octets that represent the
@@ -397,11 +388,11 @@ WS_DLL_PUBLIC guint32 get_CDR_string(tvbuff_t *tvb, const gchar **seq, int *offs
* 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 uint32_t representing a TCKind value.
*/
-WS_DLL_PUBLIC guint32 get_CDR_typeCode(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, gint *offset,
- gboolean stream_is_big_endian, int boundary, MessageHeader * header );
+WS_DLL_PUBLIC uint32_t get_CDR_typeCode(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int *offset,
+ bool stream_is_big_endian, int boundary, MessageHeader * header );
/* Copy a 4 octet sequence from the tvbuff
@@ -413,8 +404,8 @@ WS_DLL_PUBLIC guint32 get_CDR_typeCode(tvbuff_t *tvb, packet_info* pinfo, proto_
* have been processed.
*/
-WS_DLL_PUBLIC guint32 get_CDR_ulong(tvbuff_t *tvb, int *offset,
- gboolean stream_is_big_endian, int boundary);
+WS_DLL_PUBLIC uint32_t get_CDR_ulong(tvbuff_t *tvb, int *offset,
+ bool stream_is_big_endian, int boundary);
/* Copy an 8 octet sequence from the tvbuff
@@ -426,8 +417,8 @@ WS_DLL_PUBLIC guint32 get_CDR_ulong(tvbuff_t *tvb, int *offset,
* have been processed.
*/
-WS_DLL_PUBLIC guint64 get_CDR_ulong_long(tvbuff_t *tvb, int *offset,
- gboolean stream_is_big_endian, int boundary);
+WS_DLL_PUBLIC uint64_t get_CDR_ulong_long(tvbuff_t *tvb, int *offset,
+ bool stream_is_big_endian, int boundary);
/* Copy a 2 octet sequence from the tvbuff
* which represents an unsigned short value, and convert
@@ -438,13 +429,11 @@ WS_DLL_PUBLIC guint64 get_CDR_ulong_long(tvbuff_t *tvb, int *offset,
* have been processed.
*/
-WS_DLL_PUBLIC guint16 get_CDR_ushort(tvbuff_t *tvb, int *offset,
- gboolean stream_is_big_endian, int boundary);
+WS_DLL_PUBLIC uint16_t get_CDR_ushort(tvbuff_t *tvb, int *offset,
+ bool stream_is_big_endian, int boundary);
/* Copy a wchar from the tvbuff.
- * Memory is allocated in packet pool and will be
- * automatically freed once the packet dissection is finished.
* This function also increments offset according to
* the wchar size.
*
@@ -453,7 +442,7 @@ WS_DLL_PUBLIC guint16 get_CDR_ushort(tvbuff_t *tvb, int *offset,
* and therefore no size to add to the tree.
*
* For GIOP 1.2 read size of wchar and the size
- * octets. size is returned as a gint8.
+ * octets. size is returned as a int8_t.
*
* For both GIOP versions the wchar is returned
* as a printable string.
@@ -472,15 +461,13 @@ WS_DLL_PUBLIC guint16 get_CDR_ushort(tvbuff_t *tvb, int *offset,
* Wchar is not supported for GIOP 1.0.
*/
-WS_DLL_PUBLIC gint get_CDR_wchar(tvbuff_t *tvb, const gchar **seq, int *offset,
- MessageHeader * header);
+WS_DLL_PUBLIC int get_CDR_wchar(wmem_allocator_t *scope, tvbuff_t *tvb,
+ const char **seq, int *offset, MessageHeader * header);
/* Copy a wstring from the tvbuff.
- * Memory is allocated in packet pool and will be
- * automatically freed once the packet dissection is finished.
* This function also increments offset, according to
- * wstring length. length is returned as guint32
+ * wstring length. length is returned as uint32_t
*/
/* NOTE: This is very primitive in that it just reads
@@ -495,8 +482,9 @@ WS_DLL_PUBLIC gint get_CDR_wchar(tvbuff_t *tvb, const gchar **seq, int *offset,
* Wstring is not supported for GIOP 1.0.
*/
-WS_DLL_PUBLIC guint32 get_CDR_wstring(tvbuff_t *tvb, const gchar **seq, int *offset,
- gboolean stream_is_big_endian, int boundary, MessageHeader * header);
+WS_DLL_PUBLIC uint32_t get_CDR_wstring(wmem_allocator_t *scope, tvbuff_t *tvb,
+ const char **seq, int *offset, bool stream_is_big_endian, int boundary,
+ MessageHeader * header);
@@ -510,7 +498,7 @@ WS_DLL_PUBLIC guint32 get_CDR_wstring(tvbuff_t *tvb, const gchar **seq, int *off
/* Determine the byte order from the GIOP MessageHeader */
-WS_DLL_PUBLIC gboolean is_big_endian (MessageHeader * header);
+WS_DLL_PUBLIC bool is_big_endian (MessageHeader * header);
/*
* get_encap_info() for any encapsulation (eg:sequences)
@@ -518,11 +506,11 @@ WS_DLL_PUBLIC gboolean is_big_endian (MessageHeader * header);
* and *offset, and returns the sequence length.
*/
-WS_DLL_PUBLIC 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 );
+WS_DLL_PUBLIC uint32_t get_CDR_encap_info(tvbuff_t *tvb, proto_tree *tree, int *offset,
+ bool old_stream_is_big_endian, uint32_t old_boundary,
+ bool *new_stream_is_big_endian_ptr, uint32_t *new_boundary_ptr );
-/* Take in an array of guint8 and create a new ephemeral string.
+/* Take in an array of uint8_t and create a new ephemeral string.
* Replace non-printable characters with periods.
*
* The array may contain \0's so don't use strdup
@@ -530,7 +518,7 @@ WS_DLL_PUBLIC guint32 get_CDR_encap_info(tvbuff_t *tvb, proto_tree *tree, gint *
* the initial sequence.
*/
-WS_DLL_PUBLIC gchar * make_printable_string (const guint8 *in, guint32 len);
+WS_DLL_PUBLIC char * make_printable_string (wmem_allocator_t *scope, const uint8_t *in, uint32_t len);
/*
* Enums for TCkind
@@ -598,15 +586,15 @@ typedef enum TCKind TCKind_t;
/* Used for GIOP statistics */
typedef struct _giop_info_value_t {
- guint32 framenum;
+ uint32_t framenum;
address *server_addr;
- const gchar *client_host;
- const gchar *service_host;
- const gchar *giop_op;
- const gchar *giop_resp;
+ const char *client_host;
+ const char *service_host;
+ const char *giop_op;
+ const char *giop_resp;
time_t time_ticks;
- guint time_ms;
- gboolean first_pass;
+ unsigned time_ms;
+ bool first_pass;
} giop_info_value_t;