diff options
author | Graeme Lunt <graeme.lunt@smhs.co.uk> | 2010-06-09 14:45:38 +0000 |
---|---|---|
committer | Graeme Lunt <graeme.lunt@smhs.co.uk> | 2010-06-09 14:45:38 +0000 |
commit | cfdd4788cf7420dc403e99d8d24313cb300f61f3 (patch) | |
tree | 61bd0bcdb54c4a07d67f128b8d5ce18f98442ee0 /asn1/ros | |
parent | 70c26add0af7cb4c5fb96e5754bc69effa47f881 (diff) |
Updates to the ROS dissector to support IDMP and fix to IDMP for implicit declaration of return value of call_ros_oid_callback().
svn path=/trunk/; revision=33182
Diffstat (limited to 'asn1/ros')
-rw-r--r-- | asn1/ros/packet-ros-template.c | 12 | ||||
-rw-r--r-- | asn1/ros/packet-ros-template.h | 1 | ||||
-rw-r--r-- | asn1/ros/ros.cnf | 19 |
3 files changed, 24 insertions, 8 deletions
diff --git a/asn1/ros/packet-ros-template.c b/asn1/ros/packet-ros-template.c index ceef439599..dbfefba429 100644 --- a/asn1/ros/packet-ros-template.c +++ b/asn1/ros/packet-ros-template.c @@ -45,8 +45,6 @@ /* Initialize the protocol and registered fields */ static int proto_ros = -1; -static struct SESSION_DATA_STRUCTURE* session = NULL; - static proto_tree *top_tree=NULL; static guint32 opcode; static guint32 invokeid; @@ -144,8 +142,11 @@ static gboolean ros_try_string(const char *oid, tvbuff_t *tvb, packet_info *pinf const value_string *lookup; proto_item *item=NULL; proto_tree *ros_tree=NULL; + struct SESSION_DATA_STRUCTURE* session = NULL; + + session = ( (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data) ); - if((rinfo = (ros_info_t*)g_hash_table_lookup(protocol_table, oid)) != NULL) { + if((session != NULL) && ((rinfo = (ros_info_t*)g_hash_table_lookup(protocol_table, oid)) != NULL)) { if(tree){ item = proto_tree_add_item(tree, *(rinfo->proto), tvb, 0, -1, FALSE); @@ -204,7 +205,7 @@ static gboolean ros_try_string(const char *oid, tvbuff_t *tvb, packet_info *pinf return FALSE; } -static int +int call_ros_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { tvbuff_t *next_tvb; @@ -395,9 +396,6 @@ dissect_ros(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) "Internal error:can't get application context from ACSE dissector."); } return ; - } else { - session = ( (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data) ); - } conversation = find_or_create_conversation(pinfo); diff --git a/asn1/ros/packet-ros-template.h b/asn1/ros/packet-ros-template.h index 08209cb9f6..9712acd4e0 100644 --- a/asn1/ros/packet-ros-template.h +++ b/asn1/ros/packet-ros-template.h @@ -75,5 +75,6 @@ typedef struct _ros_info_t { void register_ros_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name, gboolean uses_rtse); void register_ros_protocol_info(const char *oid, const ros_info_t *rinfo, int proto _U_, const char *name, gboolean uses_rtse); +int call_ros_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree); #endif /* PACKET_ROS_H */ diff --git a/asn1/ros/ros.cnf b/asn1/ros/ros.cnf index 8e26fceb62..589737d1df 100644 --- a/asn1/ros/ros.cnf +++ b/asn1/ros/ros.cnf @@ -28,6 +28,8 @@ Reject/problem/returnResult rejectResult #.FN_BODY Invoke/argument char *oid; + struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE *)actx->pinfo->private_data; + /* not sure what the length should be - -1 for now */ proto_tree_add_text(tree, tvb, offset,-1, "invoke argument"); @@ -43,6 +45,8 @@ Reject/problem/returnResult rejectResult #.FN_BODY ReturnResult/result/result char *oid; + struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE *)actx->pinfo->private_data; + /* not sure what the length should be - -1 for now */ proto_tree_add_text(tree, tvb, offset,-1, "return result"); @@ -58,6 +62,8 @@ Reject/problem/returnResult rejectResult #.FN_BODY ReturnError/parameter char *oid; + struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE *)actx->pinfo->private_data; + /* not sure what the length should be - -1 for now */ proto_tree_add_text(tree, tvb, offset,-1, "return result"); @@ -71,9 +77,10 @@ Reject/problem/returnResult rejectResult offset = call_ros_oid_callback(oid, tvb, offset, actx->pinfo, top_tree); } - #.FN_BODY ROS/bind-invoke char *oid; + struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE *)actx->pinfo->private_data; + /* not sure what the length should be - -1 for now */ proto_tree_add_text(tree, tvb, offset,-1, "bind-invoke"); @@ -85,6 +92,8 @@ Reject/problem/returnResult rejectResult #.FN_BODY ROS/bind-result char *oid; + struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE *)actx->pinfo->private_data; + /* not sure what the length should be - -1 for now */ proto_tree_add_text(tree, tvb, offset,-1, "bind-result"); @@ -96,6 +105,8 @@ Reject/problem/returnResult rejectResult #.FN_BODY ROS/bind-error char *oid; + struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE *)actx->pinfo->private_data; + /* not sure what the length should be - -1 for now */ proto_tree_add_text(tree, tvb, offset,-1, "bind-error"); @@ -108,6 +119,8 @@ Reject/problem/returnResult rejectResult #.FN_BODY ROS/unbind-invoke char *oid; + struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE *)actx->pinfo->private_data; + /* not sure what the length should be - -1 for now */ proto_tree_add_text(tree, tvb, offset,-1, "unbind-invoke"); @@ -120,6 +133,8 @@ Reject/problem/returnResult rejectResult #.FN_BODY ROS/unbind-result char *oid; + struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE *)actx->pinfo->private_data; + /* not sure what the length should be - -1 for now */ proto_tree_add_text(tree, tvb, offset,-1, "unbind-result"); @@ -131,6 +146,8 @@ Reject/problem/returnResult rejectResult #.FN_BODY ROS/unbind-error char *oid; + struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE *)actx->pinfo->private_data; + /* not sure what the length should be - -1 for now */ proto_tree_add_text(tree, tvb, offset,-1, "unbind-error"); |