summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ros.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-ros.c')
-rw-r--r--epan/dissectors/packet-ros.c199
1 files changed, 100 insertions, 99 deletions
diff --git a/epan/dissectors/packet-ros.c b/epan/dissectors/packet-ros.c
index fe7204d6..5c56c764 100644
--- a/epan/dissectors/packet-ros.c
+++ b/epan/dissectors/packet-ros.c
@@ -1,7 +1,7 @@
/* Do not modify this file. Changes will be overwritten. */
/* Generated automatically by the ASN.1 to Wireshark dissector compiler */
/* packet-ros.c */
-/* asn2wrs.py -b -L -p ros -c ./ros.cnf -s ./packet-ros-template -D . -O ../.. ros.asn Remote-Operations-Information-Objects.asn */
+/* asn2wrs.py -b -q -L -p ros -c ./ros.cnf -s ./packet-ros-template -D . -O ../.. ros.asn Remote-Operations-Information-Objects.asn */
/* packet-ros_asn1.c
* Routines for ROS packet dissection
@@ -20,6 +20,7 @@
#include <epan/conversation.h>
#include <epan/asn1.h>
#include <epan/expert.h>
+#include <wsutil/array.h>
#include "packet-ber.h"
#include "packet-pres.h"
@@ -33,13 +34,13 @@ void proto_register_ros(void);
void proto_reg_handoff_ros(void);
/* Initialize the protocol and registered fields */
-static int proto_ros = -1;
+static int proto_ros;
-static proto_tree *top_tree=NULL;
-static guint32 opcode;
-static guint32 invokeid;
+static proto_tree *top_tree;
+static uint32_t opcode;
+static uint32_t invokeid;
-static dissector_handle_t ros_handle = NULL;
+static dissector_handle_t ros_handle;
typedef struct ros_conv_info_t {
wmem_map_t *unmatched; /* unmatched operations */
@@ -47,76 +48,76 @@ typedef struct ros_conv_info_t {
} ros_conv_info_t;
typedef struct ros_call_response {
- gboolean is_request;
- guint32 req_frame;
+ bool is_request;
+ uint32_t req_frame;
nstime_t req_time;
- guint32 rep_frame;
- guint invokeId;
+ uint32_t rep_frame;
+ unsigned invokeId;
} ros_call_response_t;
-static int hf_ros_response_in = -1;
-static int hf_ros_response_to = -1;
-static int hf_ros_time = -1;
-
-
-static int hf_ros_invoke = -1; /* Invoke */
-static int hf_ros_returnResult = -1; /* ReturnResult */
-static int hf_ros_returnError = -1; /* ReturnError */
-static int hf_ros_reject = -1; /* T_reject */
-static int hf_ros_bind_invoke = -1; /* T_bind_invoke */
-static int hf_ros_bind_result = -1; /* T_bind_result */
-static int hf_ros_bind_error = -1; /* T_bind_error */
-static int hf_ros_unbind_invoke = -1; /* T_unbind_invoke */
-static int hf_ros_unbind_result = -1; /* T_unbind_result */
-static int hf_ros_unbind_error = -1; /* T_unbind_error */
-static int hf_ros_invokeId = -1; /* InvokeId */
-static int hf_ros_linkedId = -1; /* INTEGER */
-static int hf_ros_opcode = -1; /* OperationCode */
-static int hf_ros_argument = -1; /* T_argument */
-static int hf_ros_result = -1; /* T_result */
-static int hf_ros_operationResult = -1; /* OperationResult */
-static int hf_ros_errcode = -1; /* ErrorCode */
-static int hf_ros_parameter = -1; /* T_parameter */
-static int hf_ros_problem = -1; /* T_problem */
-static int hf_ros_general = -1; /* GeneralProblem */
-static int hf_ros_invokeProblem = -1; /* InvokeProblem */
-static int hf_ros_rejectResult = -1; /* ReturnResultProblem */
-static int hf_ros_rejectError = -1; /* ReturnErrorProblem */
-static int hf_ros_present = -1; /* T_present */
-static int hf_ros_absent = -1; /* NULL */
-static int hf_ros_local = -1; /* INTEGER */
-static int hf_ros_global = -1; /* OBJECT_IDENTIFIER */
+static int hf_ros_response_in;
+static int hf_ros_response_to;
+static int hf_ros_time;
+
+
+static int hf_ros_invoke; /* Invoke */
+static int hf_ros_returnResult; /* ReturnResult */
+static int hf_ros_returnError; /* ReturnError */
+static int hf_ros_reject; /* T_reject */
+static int hf_ros_bind_invoke; /* T_bind_invoke */
+static int hf_ros_bind_result; /* T_bind_result */
+static int hf_ros_bind_error; /* T_bind_error */
+static int hf_ros_unbind_invoke; /* T_unbind_invoke */
+static int hf_ros_unbind_result; /* T_unbind_result */
+static int hf_ros_unbind_error; /* T_unbind_error */
+static int hf_ros_invokeId; /* InvokeId */
+static int hf_ros_linkedId; /* INTEGER */
+static int hf_ros_opcode; /* OperationCode */
+static int hf_ros_argument; /* T_argument */
+static int hf_ros_result; /* T_result */
+static int hf_ros_operationResult; /* OperationResult */
+static int hf_ros_errcode; /* ErrorCode */
+static int hf_ros_parameter; /* T_parameter */
+static int hf_ros_problem; /* T_problem */
+static int hf_ros_general; /* GeneralProblem */
+static int hf_ros_invokeProblem; /* InvokeProblem */
+static int hf_ros_rejectResult; /* ReturnResultProblem */
+static int hf_ros_rejectError; /* ReturnErrorProblem */
+static int hf_ros_present; /* T_present */
+static int hf_ros_absent; /* NULL */
+static int hf_ros_local; /* INTEGER */
+static int hf_ros_global; /* OBJECT_IDENTIFIER */
/* Initialize the subtree pointers */
-static gint ett_ros = -1;
-static gint ett_ros_unknown = -1;
-static gint ett_ros_invoke_argument = -1;
-static gint ett_ros_return_result = -1;
-static gint ett_ros_bind_invoke = -1;
-static gint ett_ros_bind_result = -1;
-static gint ett_ros_bind_error = -1;
-static gint ett_ros_unbind_invoke = -1;
-static gint ett_ros_unbind_result = -1;
-static gint ett_ros_unbind_error = -1;
-static gint ett_ros_ROS = -1;
-static gint ett_ros_Invoke = -1;
-static gint ett_ros_ReturnResult = -1;
-static gint ett_ros_T_result = -1;
-static gint ett_ros_ReturnError = -1;
-static gint ett_ros_Reject = -1;
-static gint ett_ros_T_problem = -1;
-static gint ett_ros_InvokeId = -1;
-static gint ett_ros_Code = -1;
-
-static expert_field ei_ros_dissector_oid_not_implemented = EI_INIT;
-static expert_field ei_ros_unknown_ros_pdu = EI_INIT;
-
-static dissector_table_t ros_oid_dissector_table=NULL;
-
-static wmem_map_t *protocol_table=NULL;
+static int ett_ros;
+static int ett_ros_unknown;
+static int ett_ros_invoke_argument;
+static int ett_ros_return_result;
+static int ett_ros_bind_invoke;
+static int ett_ros_bind_result;
+static int ett_ros_bind_error;
+static int ett_ros_unbind_invoke;
+static int ett_ros_unbind_result;
+static int ett_ros_unbind_error;
+static int ett_ros_ROS;
+static int ett_ros_Invoke;
+static int ett_ros_ReturnResult;
+static int ett_ros_T_result;
+static int ett_ros_ReturnError;
+static int ett_ros_Reject;
+static int ett_ros_T_problem;
+static int ett_ros_InvokeId;
+static int ett_ros_Code;
+
+static expert_field ei_ros_dissector_oid_not_implemented;
+static expert_field ei_ros_unknown_ros_pdu;
+
+static dissector_table_t ros_oid_dissector_table;
+
+static wmem_map_t *protocol_table;
void
-register_ros_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name, gboolean uses_rtse)
+register_ros_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name, bool uses_rtse)
{
dissector_add_string("ros.oid", oid, dissector);
@@ -126,16 +127,16 @@ register_ros_oid_dissector_handle(const char *oid, dissector_handle_t dissector,
}
void
-register_ros_protocol_info(const char *oid, const ros_info_t *rinfo, int proto _U_, const char *name, gboolean uses_rtse)
+register_ros_protocol_info(const char *oid, const ros_info_t *rinfo, int proto _U_, const char *name, bool uses_rtse)
{
- wmem_map_insert(protocol_table, (gpointer)oid, (gpointer)rinfo);
+ wmem_map_insert(protocol_table, (void *)oid, (void *)rinfo);
if(!uses_rtse)
/* if we are not using RTSE, then we must register ROS with BER (ACSE) */
register_ber_oid_dissector_handle(oid, ros_handle, proto, name);
}
-static dissector_t ros_lookup_opr_dissector(gint32 opcode_lcl, const ros_opr_t *operations, gboolean argument)
+static dissector_t ros_lookup_opr_dissector(int32_t opcode_lcl, const ros_opr_t *operations, bool argument)
{
/* we don't know what order asn2wrs/module definition is, so ... */
if(operations) {
@@ -147,7 +148,7 @@ static dissector_t ros_lookup_opr_dissector(gint32 opcode_lcl, const ros_opr_t *
return NULL;
}
-static dissector_t ros_lookup_err_dissector(gint32 errcode, const ros_err_t *errors)
+static dissector_t ros_lookup_err_dissector(int32_t errcode, const ros_err_t *errors)
{
/* we don't know what order asn2wrs/module definition is, so ... */
if(errors) {
@@ -164,9 +165,9 @@ static int
ros_try_string(const char *oid, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, struct SESSION_DATA_STRUCTURE* session)
{
ros_info_t *rinfo;
- gint32 opcode_lcl = 0;
- const gchar *opname = NULL;
- const gchar *suffix = NULL;
+ int32_t opcode_lcl = 0;
+ const char *opname = NULL;
+ const char *suffix = NULL;
dissector_t opdissector = NULL;
const value_string *lookup;
proto_item *item=NULL;
@@ -197,11 +198,11 @@ ros_try_string(const char *oid, tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
switch(session->ros_op & ROS_OP_PDU_MASK) {
case ROS_OP_ARGUMENT:
- opdissector = ros_lookup_opr_dissector(opcode_lcl, rinfo->opr_code_dissectors, TRUE);
+ opdissector = ros_lookup_opr_dissector(opcode_lcl, rinfo->opr_code_dissectors, true);
suffix = "_argument";
break;
case ROS_OP_RESULT:
- opdissector = ros_lookup_opr_dissector(opcode_lcl, rinfo->opr_code_dissectors, FALSE);
+ opdissector = ros_lookup_opr_dissector(opcode_lcl, rinfo->opr_code_dissectors, false);
suffix = "_result";
break;
case ROS_OP_ERROR:
@@ -254,16 +255,16 @@ call_ros_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *p
}
-static guint
-ros_info_hash_matched(gconstpointer k)
+static unsigned
+ros_info_hash_matched(const void *k)
{
const ros_call_response_t *key = (const ros_call_response_t *)k;
return key->invokeId;
}
-static gint
-ros_info_equal_matched(gconstpointer k1, gconstpointer k2)
+static int
+ros_info_equal_matched(const void *k1, const void *k2)
{
const ros_call_response_t *key1 = (const ros_call_response_t *)k1;
const ros_call_response_t *key2 = (const ros_call_response_t *)k2;
@@ -280,16 +281,16 @@ ros_info_equal_matched(gconstpointer k1, gconstpointer k2)
return key1->invokeId==key2->invokeId;
}
-static guint
-ros_info_hash_unmatched(gconstpointer k)
+static unsigned
+ros_info_hash_unmatched(const void *k)
{
const ros_call_response_t *key = (const ros_call_response_t *)k;
return key->invokeId;
}
-static gint
-ros_info_equal_unmatched(gconstpointer k1, gconstpointer k2)
+static int
+ros_info_equal_unmatched(const void *k1, const void *k2)
{
const ros_call_response_t *key1 = (const ros_call_response_t *)k1;
const ros_call_response_t *key2 = (const ros_call_response_t *)k2;
@@ -298,7 +299,7 @@ ros_info_equal_unmatched(gconstpointer k1, gconstpointer k2)
}
static ros_call_response_t *
-ros_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint invokeId, gboolean isInvoke)
+ros_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned invokeId, bool isInvoke)
{
ros_call_response_t rcr, *rcrp=NULL;
ros_conv_info_t *ros_info;
@@ -356,7 +357,7 @@ ros_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui
rcrp->req_frame=pinfo->num;
rcrp->req_time=pinfo->abs_ts;
rcrp->rep_frame=0;
- rcrp->is_request=TRUE;
+ rcrp->is_request=true;
wmem_map_insert(ros_info->unmatched, rcrp, rcrp);
return NULL;
@@ -372,7 +373,7 @@ ros_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui
if(!rcrp->rep_frame){
wmem_map_remove(ros_info->unmatched, rcrp);
rcrp->rep_frame=pinfo->num;
- rcrp->is_request=FALSE;
+ rcrp->is_request=false;
wmem_map_insert(ros_info->matched, rcrp, rcrp);
}
}
@@ -470,7 +471,7 @@ dissect_ros_T_argument(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_,
/* not sure what the length should be - -1 for now */
subtree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_ros_invoke_argument, NULL, "invoke argument");
- ros_match_call_response(tvb, actx->pinfo, subtree, invokeid, TRUE);
+ ros_match_call_response(tvb, actx->pinfo, subtree, invokeid, true);
if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) {
/* this should be ROS! */
@@ -512,7 +513,7 @@ dissect_ros_OperationResult(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset
/* not sure what the length should be - -1 for now */
subtree = proto_tree_add_subtree(tree, tvb, offset,-1, ett_ros_return_result, NULL, "return result");
- ros_match_call_response(tvb, actx->pinfo, subtree, invokeid, FALSE);
+ ros_match_call_response(tvb, actx->pinfo, subtree, invokeid, false);
if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) {
/* this should be ROS! */
@@ -577,7 +578,7 @@ dissect_ros_T_parameter(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_
/* not sure what the length should be - -1 for now */
subtree = proto_tree_add_subtree(tree, tvb, offset,-1, ett_ros_return_result, NULL, "return result");
- ros_match_call_response(tvb, actx->pinfo, subtree, invokeid, FALSE);
+ ros_match_call_response(tvb, actx->pinfo, subtree, invokeid, false);
if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) {
/* this should be ROS! */
@@ -618,7 +619,7 @@ static const value_string ros_GeneralProblem_vals[] = {
static int
dissect_ros_GeneralProblem(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
- guint32 problem;
+ uint32_t problem;
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
&problem);
@@ -646,7 +647,7 @@ static const value_string ros_InvokeProblem_vals[] = {
static int
dissect_ros_InvokeProblem(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
- guint32 problem;
+ uint32_t problem;
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
&problem);
@@ -669,7 +670,7 @@ static const value_string ros_ReturnResultProblem_vals[] = {
static int
dissect_ros_ReturnResultProblem(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
- guint32 problem;
+ uint32_t problem;
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
&problem);
@@ -694,7 +695,7 @@ static const value_string ros_ReturnErrorProblem_vals[] = {
static int
dissect_ros_ReturnErrorProblem(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
- guint32 problem;
+ uint32_t problem;
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
&problem);
@@ -965,7 +966,7 @@ dissect_ros(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* da
conversation_t *conversation;
ros_conv_info_t *ros_info = NULL;
asn1_ctx_t asn1_ctx;
- asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
+ asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
/* do we have application context from the acse dissector? */
if (data == NULL)
@@ -1000,7 +1001,7 @@ dissect_ros(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* da
while (tvb_reported_length_remaining(tvb, offset) > 0){
old_offset=offset;
- offset=dissect_ros_ROS(FALSE, tvb, offset, &asn1_ctx , tree, -1);
+ offset=dissect_ros_ROS(false, tvb, offset, &asn1_ctx , tree, -1);
if(offset == old_offset){
next_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_ros_unknown, &item, "Unknown ROS PDU");
@@ -1143,7 +1144,7 @@ void proto_register_ros(void) {
};
/* List of subtrees */
- static gint *ett[] = {
+ static int *ett[] = {
&ett_ros,
&ett_ros_unknown,
&ett_ros_invoke_argument,