MSWSP: add two more Property Sets
[wireshark-wip.git] / epan / dissectors / packet-ros.c
blob5048da771afa186bd826bcefa3b88488328e42b2
1 /* Do not modify this file. Changes will be overwritten. */
2 /* Generated automatically by the ASN.1 to Wireshark dissector compiler */
3 /* packet-ros.c */
4 /* ../../tools/asn2wrs.py -b -p ros -c ./ros.cnf -s ./packet-ros-template -D . -O ../../epan/dissectors ros.asn Remote-Operations-Information-Objects.asn */
6 /* Input file: packet-ros-template.c */
8 #line 1 "../../asn1/ros/packet-ros-template.c"
9 /* packet-ros_asn1.c
10 * Routines for ROS packet dissection
11 * Graeme Lunt 2005
13 * $Id$
15 * Wireshark - Network traffic analyzer
16 * By Gerald Combs <gerald@wireshark.org>
17 * Copyright 1998 Gerald Combs
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version 2
22 * of the License, or (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
34 #include "config.h"
36 #include <glib.h>
37 #include <epan/packet.h>
38 #include <epan/conversation.h>
39 #include <epan/wmem/wmem.h>
40 #include <epan/asn1.h>
41 #include <epan/expert.h>
43 #include "packet-ber.h"
44 #include "packet-pres.h"
45 #include "packet-ros.h"
47 #define PNAME "X.880 OSI Remote Operations Service"
48 #define PSNAME "ROS"
49 #define PFNAME "ros"
51 void proto_register_ros(void);
52 void proto_reg_handoff_ros(void);
54 /* Initialize the protocol and registered fields */
55 static int proto_ros = -1;
57 static proto_tree *top_tree=NULL;
58 static guint32 opcode;
59 static guint32 invokeid;
61 static dissector_handle_t ros_handle = NULL;
63 typedef struct ros_conv_info_t {
64 struct ros_conv_info_t *next;
65 GHashTable *unmatched; /* unmatched operations */
66 GHashTable *matched; /* matched operations */
67 } ros_conv_info_t;
69 static ros_conv_info_t *ros_info_items = NULL;
71 typedef struct ros_call_response {
72 gboolean is_request;
73 guint32 req_frame;
74 nstime_t req_time;
75 guint32 rep_frame;
76 guint invokeId;
77 } ros_call_response_t;
79 static int hf_ros_response_in = -1;
80 static int hf_ros_response_to = -1;
81 static int hf_ros_time = -1;
85 /*--- Included file: packet-ros-hf.c ---*/
86 #line 1 "../../asn1/ros/packet-ros-hf.c"
87 static int hf_ros_invoke = -1; /* Invoke */
88 static int hf_ros_returnResult = -1; /* ReturnResult */
89 static int hf_ros_returnError = -1; /* ReturnError */
90 static int hf_ros_reject = -1; /* T_reject */
91 static int hf_ros_bind_invoke = -1; /* T_bind_invoke */
92 static int hf_ros_bind_result = -1; /* T_bind_result */
93 static int hf_ros_bind_error = -1; /* T_bind_error */
94 static int hf_ros_unbind_invoke = -1; /* T_unbind_invoke */
95 static int hf_ros_unbind_result = -1; /* T_unbind_result */
96 static int hf_ros_unbind_error = -1; /* T_unbind_error */
97 static int hf_ros_invokeId = -1; /* InvokeId */
98 static int hf_ros_linkedId = -1; /* INTEGER */
99 static int hf_ros_opcode = -1; /* OperationCode */
100 static int hf_ros_argument = -1; /* T_argument */
101 static int hf_ros_result = -1; /* T_result */
102 static int hf_ros_operationResult = -1; /* OperationResult */
103 static int hf_ros_errcode = -1; /* ErrorCode */
104 static int hf_ros_parameter = -1; /* T_parameter */
105 static int hf_ros_problem = -1; /* T_problem */
106 static int hf_ros_general = -1; /* GeneralProblem */
107 static int hf_ros_invokeProblem = -1; /* InvokeProblem */
108 static int hf_ros_rejectResult = -1; /* ReturnResultProblem */
109 static int hf_ros_rejectError = -1; /* ReturnErrorProblem */
110 static int hf_ros_present = -1; /* T_present */
111 static int hf_ros_absent = -1; /* NULL */
112 static int hf_ros_local = -1; /* INTEGER */
113 static int hf_ros_global = -1; /* OBJECT_IDENTIFIER */
115 /*--- End of included file: packet-ros-hf.c ---*/
116 #line 77 "../../asn1/ros/packet-ros-template.c"
118 /* Initialize the subtree pointers */
119 static gint ett_ros = -1;
121 /*--- Included file: packet-ros-ett.c ---*/
122 #line 1 "../../asn1/ros/packet-ros-ett.c"
123 static gint ett_ros_ROS = -1;
124 static gint ett_ros_Invoke = -1;
125 static gint ett_ros_ReturnResult = -1;
126 static gint ett_ros_T_result = -1;
127 static gint ett_ros_ReturnError = -1;
128 static gint ett_ros_Reject = -1;
129 static gint ett_ros_T_problem = -1;
130 static gint ett_ros_InvokeId = -1;
131 static gint ett_ros_Code = -1;
133 /*--- End of included file: packet-ros-ett.c ---*/
134 #line 81 "../../asn1/ros/packet-ros-template.c"
136 static expert_field ei_ros_dissector_oid_not_implemented = EI_INIT;
137 static expert_field ei_ros_unknown_ros_pdu = EI_INIT;
139 static dissector_table_t ros_oid_dissector_table=NULL;
141 static GHashTable *oid_table=NULL;
142 static GHashTable *protocol_table=NULL;
143 static gint ett_ros_unknown = -1;
145 void
146 register_ros_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name, gboolean uses_rtse)
148 dissector_add_string("ros.oid", oid, dissector);
149 g_hash_table_insert(oid_table, (gpointer)oid, (gpointer)name);
151 if(!uses_rtse)
152 /* if we are not using RTSE, then we must register ROS with BER (ACSE) */
153 register_ber_oid_dissector_handle(oid, ros_handle, proto, name);
156 void
157 register_ros_protocol_info(const char *oid, const ros_info_t *rinfo, int proto _U_, const char *name, gboolean uses_rtse)
159 g_hash_table_insert(protocol_table, (gpointer)oid, (gpointer)rinfo);
160 g_hash_table_insert(oid_table, (gpointer)oid, (gpointer)name);
162 if(!uses_rtse)
163 /* if we are not using RTSE, then we must register ROS with BER (ACSE) */
164 register_ber_oid_dissector_handle(oid, ros_handle, proto, name);
167 static new_dissector_t ros_lookup_opr_dissector(gint32 opcode_lcl, const ros_opr_t *operations, gboolean argument)
169 /* we don't know what order asn2wrs/module definition is, so ... */
170 if(operations) {
171 for(;operations->arg_pdu != (new_dissector_t)(-1); operations++)
172 if(operations->opcode == opcode_lcl)
173 return argument ? operations->arg_pdu : operations->res_pdu;
176 return NULL;
179 static new_dissector_t ros_lookup_err_dissector(gint32 errcode, const ros_err_t *errors)
181 /* we don't know what order asn2wrs/module definition is, so ... */
182 if(errors) {
183 for(;errors->err_pdu != (new_dissector_t) (-1); errors++) {
184 if(errors->errcode == errcode)
185 return errors->err_pdu;
188 return NULL;
192 static gboolean ros_try_string(const char *oid, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, struct SESSION_DATA_STRUCTURE* session)
194 ros_info_t *rinfo;
195 gint32 opcode_lcl = 0;
196 const gchar *opname = NULL;
197 const gchar *suffix = NULL;
198 new_dissector_t opdissector = NULL;
199 const value_string *lookup;
200 proto_item *item=NULL;
201 proto_tree *ros_tree=NULL;
203 if((session != NULL) && ((rinfo = (ros_info_t*)g_hash_table_lookup(protocol_table, oid)) != NULL)) {
205 if(tree){
206 item = proto_tree_add_item(tree, *(rinfo->proto), tvb, 0, -1, ENC_NA);
207 ros_tree = proto_item_add_subtree(item, *(rinfo->ett_proto));
210 col_set_str(pinfo->cinfo, COL_PROTOCOL, rinfo->name);
212 /* if this is a bind operation */
213 if((session->ros_op & ROS_OP_TYPE_MASK) == ROS_OP_BIND) {
214 /* use the in-built operation codes */
215 if((session->ros_op & ROS_OP_PDU_MASK) == ROS_OP_ERROR)
216 opcode_lcl = err_ros_bind;
217 else
218 opcode_lcl = op_ros_bind;
219 } else
220 /* otherwise just take the opcode */
221 opcode_lcl = session->ros_op & ROS_OP_OPCODE_MASK;
223 /* default lookup in the operations */
224 lookup = rinfo->opr_code_strings;
226 switch(session->ros_op & ROS_OP_PDU_MASK) {
227 case ROS_OP_ARGUMENT:
228 opdissector = ros_lookup_opr_dissector(opcode_lcl, rinfo->opr_code_dissectors, TRUE);
229 suffix = "_argument";
230 break;
231 case ROS_OP_RESULT:
232 opdissector = ros_lookup_opr_dissector(opcode_lcl, rinfo->opr_code_dissectors, FALSE);
233 suffix = "_result";
234 break;
235 case ROS_OP_ERROR:
236 opdissector = ros_lookup_err_dissector(opcode_lcl, rinfo->err_code_dissectors);
237 lookup = rinfo->err_code_strings;
238 break;
239 default:
240 break;
243 if(opdissector) {
245 opname = val_to_str(opcode_lcl, lookup, "Unknown opcode (%d)");
247 col_set_str(pinfo->cinfo, COL_INFO, opname);
248 if(suffix)
249 col_append_str(pinfo->cinfo, COL_INFO, suffix);
251 (*opdissector)(tvb, pinfo, ros_tree, NULL);
253 return TRUE;
257 return FALSE;
261 call_ros_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, struct SESSION_DATA_STRUCTURE* session)
263 tvbuff_t *next_tvb;
265 next_tvb = tvb_new_subset_remaining(tvb, offset);
267 if(!ros_try_string(oid, next_tvb, pinfo, tree, session) &&
268 !dissector_try_string(ros_oid_dissector_table, oid, next_tvb, pinfo, tree, session)){
269 proto_item *item=proto_tree_add_text(tree, next_tvb, 0, tvb_length_remaining(tvb, offset), "ROS: Dissector for OID:%s not implemented. Contact Wireshark developers if you want this supported", oid);
270 proto_tree *next_tree=proto_item_add_subtree(item, ett_ros_unknown);
272 expert_add_info_format(pinfo, item, &ei_ros_dissector_oid_not_implemented,
273 "ROS: Dissector for OID %s not implemented", oid);
274 dissect_unknown_ber(pinfo, next_tvb, offset, next_tree);
277 /*XXX until we change the #.REGISTER signature for _PDU()s
278 * into new_dissector_t we have to do this kludge with
279 * manually step past the content in the ANY type.
281 offset+=tvb_length_remaining(tvb, offset);
283 return offset;
287 static guint
288 ros_info_hash_matched(gconstpointer k)
290 const ros_call_response_t *key = (const ros_call_response_t *)k;
292 return key->invokeId;
295 static gint
296 ros_info_equal_matched(gconstpointer k1, gconstpointer k2)
298 const ros_call_response_t *key1 = (const ros_call_response_t *)k1;
299 const ros_call_response_t *key2 = (const ros_call_response_t *)k2;
301 if( key1->req_frame && key2->req_frame && (key1->req_frame!=key2->req_frame) ){
302 return 0;
304 /* a response may span multiple frames
305 if( key1->rep_frame && key2->rep_frame && (key1->rep_frame!=key2->rep_frame) ){
306 return 0;
310 return key1->invokeId==key2->invokeId;
313 static guint
314 ros_info_hash_unmatched(gconstpointer k)
316 const ros_call_response_t *key = (const ros_call_response_t *)k;
318 return key->invokeId;
321 static gint
322 ros_info_equal_unmatched(gconstpointer k1, gconstpointer k2)
324 const ros_call_response_t *key1 = (const ros_call_response_t *)k1;
325 const ros_call_response_t *key2 = (const ros_call_response_t *)k2;
327 return key1->invokeId==key2->invokeId;
330 static ros_call_response_t *
331 ros_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint invokeId, gboolean isInvoke)
333 ros_call_response_t rcr, *rcrp=NULL;
334 ros_conv_info_t *ros_info = ros_info_items;
336 /* first see if we have already matched this */
338 rcr.invokeId=invokeId;
339 rcr.is_request = isInvoke;
341 if(isInvoke) {
342 rcr.req_frame=pinfo->fd->num;
343 rcr.rep_frame=0;
344 } else {
345 rcr.req_frame=0;
346 rcr.rep_frame=pinfo->fd->num;
349 rcrp=(ros_call_response_t *)g_hash_table_lookup(ros_info->matched, &rcr);
351 if(rcrp) {
352 /* we have found a match */
353 rcrp->is_request=rcr.is_request;
355 } else {
357 /* we haven't found a match - try and match it up */
359 if(isInvoke) {
360 /* this a a request - add it to the unmatched list */
362 /* check that we dont already have one of those in the
363 unmatched list and if so remove it */
365 rcr.invokeId=invokeId;
367 rcrp=(ros_call_response_t *)g_hash_table_lookup(ros_info->unmatched, &rcr);
369 if(rcrp){
370 g_hash_table_remove(ros_info->unmatched, rcrp);
373 /* if we cant reuse the old one, grab a new chunk */
374 if(!rcrp){
375 rcrp=wmem_new(wmem_file_scope(), ros_call_response_t);
377 rcrp->invokeId=invokeId;
378 rcrp->req_frame=pinfo->fd->num;
379 rcrp->req_time=pinfo->fd->abs_ts;
380 rcrp->rep_frame=0;
381 rcrp->is_request=TRUE;
382 g_hash_table_insert(ros_info->unmatched, rcrp, rcrp);
383 return NULL;
385 } else {
387 /* this is a result - it should be in our unmatched list */
389 rcr.invokeId=invokeId;
390 rcrp=(ros_call_response_t *)g_hash_table_lookup(ros_info->unmatched, &rcr);
392 if(rcrp){
394 if(!rcrp->rep_frame){
395 g_hash_table_remove(ros_info->unmatched, rcrp);
396 rcrp->rep_frame=pinfo->fd->num;
397 rcrp->is_request=FALSE;
398 g_hash_table_insert(ros_info->matched, rcrp, rcrp);
404 if(rcrp){ /* we have found a match */
405 proto_item *item = NULL;
407 if(rcrp->is_request){
408 item=proto_tree_add_uint(tree, hf_ros_response_in, tvb, 0, 0, rcrp->rep_frame);
409 PROTO_ITEM_SET_GENERATED (item);
410 } else {
411 nstime_t ns;
412 item=proto_tree_add_uint(tree, hf_ros_response_to, tvb, 0, 0, rcrp->req_frame);
413 PROTO_ITEM_SET_GENERATED (item);
414 nstime_delta(&ns, &pinfo->fd->abs_ts, &rcrp->req_time);
415 item=proto_tree_add_time(tree, hf_ros_time, tvb, 0, 0, &ns);
416 PROTO_ITEM_SET_GENERATED (item);
420 return rcrp;
424 /*--- Included file: packet-ros-fn.c ---*/
425 #line 1 "../../asn1/ros/packet-ros-fn.c"
428 static int
429 dissect_ros_T_present(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
430 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
431 &invokeid);
433 return offset;
438 static int
439 dissect_ros_NULL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
440 offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
442 return offset;
446 const value_string ros_InvokeId_vals[] = {
447 { 0, "present" },
448 { 1, "absent" },
449 { 0, NULL }
452 static const ber_choice_t InvokeId_choice[] = {
453 { 0, &hf_ros_present , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ros_T_present },
454 { 1, &hf_ros_absent , BER_CLASS_UNI, BER_UNI_TAG_NULL, BER_FLAGS_NOOWNTAG, dissect_ros_NULL },
455 { 0, NULL, 0, 0, 0, NULL }
459 dissect_ros_InvokeId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
460 offset = dissect_ber_choice(actx, tree, tvb, offset,
461 InvokeId_choice, hf_index, ett_ros_InvokeId,
462 NULL);
464 return offset;
469 static int
470 dissect_ros_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
471 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
472 NULL);
474 return offset;
479 static int
480 dissect_ros_OperationCode(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
481 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
482 &opcode);
484 return offset;
489 static int
490 dissect_ros_T_argument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
491 #line 32 "../../asn1/ros/ros.cnf"
492 char *oid;
493 struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE *)actx->private_data;
495 /* not sure what the length should be - -1 for now */
496 proto_tree_add_text(tree, tvb, offset,-1, "invoke argument");
498 ros_match_call_response(tvb, actx->pinfo, tree, invokeid, TRUE);
500 if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) {
501 /* this should be ROS! */
502 session->ros_op = (ROS_OP_INVOKE | ROS_OP_ARGUMENT);
503 /* now add the opcode */
504 session->ros_op |= opcode;
505 offset = call_ros_oid_callback(oid, tvb, offset, actx->pinfo, top_tree, session);
510 return offset;
514 static const ber_sequence_t Invoke_sequence[] = {
515 { &hf_ros_invokeId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ros_InvokeId },
516 { &hf_ros_linkedId , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ros_INTEGER },
517 { &hf_ros_opcode , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ros_OperationCode },
518 { &hf_ros_argument , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ros_T_argument },
519 { NULL, 0, 0, 0, NULL }
522 static int
523 dissect_ros_Invoke(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
524 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
525 Invoke_sequence, hf_index, ett_ros_Invoke);
527 return offset;
532 static int
533 dissect_ros_OperationResult(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
534 #line 49 "../../asn1/ros/ros.cnf"
535 char *oid;
536 struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE *)actx->private_data;
538 /* not sure what the length should be - -1 for now */
539 proto_tree_add_text(tree, tvb, offset,-1, "return result");
541 ros_match_call_response(tvb, actx->pinfo, tree, invokeid, FALSE);
543 if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) {
544 /* this should be ROS! */
545 session->ros_op = (ROS_OP_INVOKE | ROS_OP_RESULT);
546 /* now add the opcode */
547 session->ros_op |= opcode;
548 offset = call_ros_oid_callback(oid, tvb, offset, actx->pinfo, top_tree, session);
553 return offset;
557 static const ber_sequence_t T_result_sequence[] = {
558 { &hf_ros_opcode , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ros_OperationCode },
559 { &hf_ros_operationResult , BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_ros_OperationResult },
560 { NULL, 0, 0, 0, NULL }
563 static int
564 dissect_ros_T_result(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
565 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
566 T_result_sequence, hf_index, ett_ros_T_result);
568 return offset;
572 static const ber_sequence_t ReturnResult_sequence[] = {
573 { &hf_ros_invokeId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ros_InvokeId },
574 { &hf_ros_result , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ros_T_result },
575 { NULL, 0, 0, 0, NULL }
578 static int
579 dissect_ros_ReturnResult(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
580 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
581 ReturnResult_sequence, hf_index, ett_ros_ReturnResult);
583 return offset;
588 static int
589 dissect_ros_ErrorCode(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
590 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
591 &opcode);
593 return offset;
598 static int
599 dissect_ros_T_parameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
600 #line 66 "../../asn1/ros/ros.cnf"
601 char *oid;
602 struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE *)actx->private_data;
604 /* not sure what the length should be - -1 for now */
605 proto_tree_add_text(tree, tvb, offset,-1, "return result");
607 ros_match_call_response(tvb, actx->pinfo, tree, invokeid, FALSE);
609 if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) {
610 /* this should be ROS! */
611 session->ros_op = (ROS_OP_INVOKE | ROS_OP_ERROR);
612 /* now add the opcode (really the error code) */
613 session->ros_op |= opcode;
614 offset = call_ros_oid_callback(oid, tvb, offset, actx->pinfo, top_tree, session);
619 return offset;
623 static const ber_sequence_t ReturnError_sequence[] = {
624 { &hf_ros_invokeId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ros_InvokeId },
625 { &hf_ros_errcode , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ros_ErrorCode },
626 { &hf_ros_parameter , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ros_T_parameter },
627 { NULL, 0, 0, 0, NULL }
630 static int
631 dissect_ros_ReturnError(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
632 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
633 ReturnError_sequence, hf_index, ett_ros_ReturnError);
635 return offset;
639 static const value_string ros_GeneralProblem_vals[] = {
640 { 0, "unrecognizedPDU" },
641 { 1, "mistypedPDU" },
642 { 2, "badlyStructuredPDU" },
643 { 0, NULL }
647 static int
648 dissect_ros_GeneralProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
649 #line 170 "../../asn1/ros/ros.cnf"
650 guint32 problem;
652 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
653 &problem);
656 col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", val_to_str(problem, ros_GeneralProblem_vals, "GeneralProblem(%d)"));
660 return offset;
664 static const value_string ros_InvokeProblem_vals[] = {
665 { 0, "duplicateInvocation" },
666 { 1, "unrecognizedOperation" },
667 { 2, "mistypedArgument" },
668 { 3, "resourceLimitation" },
669 { 4, "releaseInProgress" },
670 { 5, "unrecognizedLinkedId" },
671 { 6, "linkedResponseUnexpected" },
672 { 7, "unexpectedLinkedOperation" },
673 { 0, NULL }
677 static int
678 dissect_ros_InvokeProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
679 #line 180 "../../asn1/ros/ros.cnf"
680 guint32 problem;
682 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
683 &problem);
686 col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", val_to_str(problem, ros_InvokeProblem_vals, "InvokeProblem(%d)"));
690 return offset;
694 static const value_string ros_ReturnResultProblem_vals[] = {
695 { 0, "unrecognizedInvocation" },
696 { 1, "resultResponseUnexpected" },
697 { 2, "mistypedResult" },
698 { 0, NULL }
702 static int
703 dissect_ros_ReturnResultProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
704 #line 190 "../../asn1/ros/ros.cnf"
705 guint32 problem;
707 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
708 &problem);
711 col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", val_to_str(problem, ros_ReturnResultProblem_vals, "ReturnResultProblem(%d)"));
715 return offset;
719 static const value_string ros_ReturnErrorProblem_vals[] = {
720 { 0, "unrecognizedInvocation" },
721 { 1, "errorResponseUnexpected" },
722 { 2, "unrecognizedError" },
723 { 3, "unexpectedError" },
724 { 4, "mistypedParameter" },
725 { 0, NULL }
729 static int
730 dissect_ros_ReturnErrorProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
731 #line 200 "../../asn1/ros/ros.cnf"
732 guint32 problem;
734 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
735 &problem);
738 col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", val_to_str(problem, ros_ReturnErrorProblem_vals, "ReturnErrorProblem(%d)"));
742 return offset;
746 static const value_string ros_T_problem_vals[] = {
747 { 0, "general" },
748 { 1, "invoke" },
749 { 2, "returnResult" },
750 { 3, "returnError" },
751 { 0, NULL }
754 static const ber_choice_t T_problem_choice[] = {
755 { 0, &hf_ros_general , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ros_GeneralProblem },
756 { 1, &hf_ros_invokeProblem , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ros_InvokeProblem },
757 { 2, &hf_ros_rejectResult , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_ros_ReturnResultProblem },
758 { 3, &hf_ros_rejectError , BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_ros_ReturnErrorProblem },
759 { 0, NULL, 0, 0, 0, NULL }
762 static int
763 dissect_ros_T_problem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
764 offset = dissect_ber_choice(actx, tree, tvb, offset,
765 T_problem_choice, hf_index, ett_ros_T_problem,
766 NULL);
768 return offset;
772 static const ber_sequence_t Reject_sequence[] = {
773 { &hf_ros_invokeId , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ros_InvokeId },
774 { &hf_ros_problem , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ros_T_problem },
775 { NULL, 0, 0, 0, NULL }
778 static int
779 dissect_ros_Reject(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
780 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
781 Reject_sequence, hf_index, ett_ros_Reject);
783 return offset;
788 static int
789 dissect_ros_T_reject(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
790 #line 163 "../../asn1/ros/ros.cnf"
791 col_set_str(actx->pinfo->cinfo, COL_INFO, "Reject");
792 offset = dissect_ros_Reject(implicit_tag, tvb, offset, actx, tree, hf_index);
797 return offset;
802 static int
803 dissect_ros_T_bind_invoke(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
804 #line 83 "../../asn1/ros/ros.cnf"
805 char *oid;
806 struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE *)actx->private_data;
808 /* not sure what the length should be - -1 for now */
809 proto_tree_add_text(tree, tvb, offset,-1, "bind-invoke");
811 if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) {
812 /* this should be ROS! */
813 session->ros_op = (ROS_OP_BIND | ROS_OP_ARGUMENT);
814 offset = call_ros_oid_callback(oid, tvb, offset, actx->pinfo, top_tree, session);
819 return offset;
824 static int
825 dissect_ros_T_bind_result(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
826 #line 96 "../../asn1/ros/ros.cnf"
827 char *oid;
828 struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE *)actx->private_data;
830 /* not sure what the length should be - -1 for now */
831 proto_tree_add_text(tree, tvb, offset,-1, "bind-result");
833 if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) {
834 /* this should be ROS! */
835 session->ros_op = (ROS_OP_BIND | ROS_OP_RESULT);
836 offset = call_ros_oid_callback(oid, tvb, offset, actx->pinfo, top_tree, session);
841 return offset;
846 static int
847 dissect_ros_T_bind_error(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
848 #line 109 "../../asn1/ros/ros.cnf"
849 char *oid;
850 struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE *)actx->private_data;
852 /* not sure what the length should be - -1 for now */
853 proto_tree_add_text(tree, tvb, offset,-1, "bind-error");
855 if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) {
856 /* this should be ROS! */
857 session->ros_op = (ROS_OP_BIND | ROS_OP_ERROR);
858 offset = call_ros_oid_callback(oid, tvb, offset, actx->pinfo, top_tree, session);
864 return offset;
869 static int
870 dissect_ros_T_unbind_invoke(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
871 #line 123 "../../asn1/ros/ros.cnf"
872 char *oid;
873 struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE *)actx->private_data;
875 /* not sure what the length should be - -1 for now */
876 proto_tree_add_text(tree, tvb, offset,-1, "unbind-invoke");
878 if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) {
879 /* this should be ROS! */
880 session->ros_op = (ROS_OP_UNBIND | ROS_OP_ARGUMENT);
881 offset = call_ros_oid_callback(oid, tvb, offset, actx->pinfo, top_tree, session);
887 return offset;
892 static int
893 dissect_ros_T_unbind_result(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
894 #line 137 "../../asn1/ros/ros.cnf"
895 char *oid;
896 struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE *)actx->private_data;
898 /* not sure what the length should be - -1 for now */
899 proto_tree_add_text(tree, tvb, offset,-1, "unbind-result");
901 if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) {
902 /* this should be ROS! */
903 session->ros_op = (ROS_OP_UNBIND | ROS_OP_RESULT);
904 offset = call_ros_oid_callback(oid, tvb, offset, actx->pinfo, top_tree, session);
909 return offset;
914 static int
915 dissect_ros_T_unbind_error(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
916 #line 150 "../../asn1/ros/ros.cnf"
917 char *oid;
918 struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE *)actx->private_data;
920 /* not sure what the length should be - -1 for now */
921 proto_tree_add_text(tree, tvb, offset,-1, "unbind-error");
923 if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) {
924 /* this should be ROS! */
925 session->ros_op = (ROS_OP_UNBIND | ROS_OP_ERROR);
926 offset = call_ros_oid_callback(oid, tvb, offset, actx->pinfo, top_tree, session);
931 return offset;
935 const value_string ros_ROS_vals[] = {
936 { 1, "invoke" },
937 { 2, "returnResult" },
938 { 3, "returnError" },
939 { 4, "reject" },
940 { 16, "bind-invoke" },
941 { 17, "bind-result" },
942 { 18, "bind-error" },
943 { 19, "unbind-invoke" },
944 { 20, "unbind-result" },
945 { 21, "unbind-error" },
946 { 0, NULL }
949 static const ber_choice_t ROS_choice[] = {
950 { 1, &hf_ros_invoke , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ros_Invoke },
951 { 2, &hf_ros_returnResult , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_ros_ReturnResult },
952 { 3, &hf_ros_returnError , BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_ros_ReturnError },
953 { 4, &hf_ros_reject , BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_ros_T_reject },
954 { 16, &hf_ros_bind_invoke , BER_CLASS_CON, 16, BER_FLAGS_IMPLTAG, dissect_ros_T_bind_invoke },
955 { 17, &hf_ros_bind_result , BER_CLASS_CON, 17, BER_FLAGS_IMPLTAG, dissect_ros_T_bind_result },
956 { 18, &hf_ros_bind_error , BER_CLASS_CON, 18, BER_FLAGS_IMPLTAG, dissect_ros_T_bind_error },
957 { 19, &hf_ros_unbind_invoke , BER_CLASS_CON, 19, BER_FLAGS_IMPLTAG, dissect_ros_T_unbind_invoke },
958 { 20, &hf_ros_unbind_result , BER_CLASS_CON, 20, BER_FLAGS_IMPLTAG, dissect_ros_T_unbind_result },
959 { 21, &hf_ros_unbind_error , BER_CLASS_CON, 21, BER_FLAGS_IMPLTAG, dissect_ros_T_unbind_error },
960 { 0, NULL, 0, 0, 0, NULL }
964 dissect_ros_ROS(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
965 offset = dissect_ber_choice(actx, tree, tvb, offset,
966 ROS_choice, hf_index, ett_ros_ROS,
967 NULL);
969 return offset;
974 static int
975 dissect_ros_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
976 offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
978 return offset;
982 const value_string ros_Code_vals[] = {
983 { 0, "local" },
984 { 1, "global" },
985 { 0, NULL }
988 static const ber_choice_t Code_choice[] = {
989 { 0, &hf_ros_local , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ros_INTEGER },
990 { 1, &hf_ros_global , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_ros_OBJECT_IDENTIFIER },
991 { 0, NULL, 0, 0, 0, NULL }
995 dissect_ros_Code(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
996 offset = dissect_ber_choice(actx, tree, tvb, offset,
997 Code_choice, hf_index, ett_ros_Code,
998 NULL);
1000 return offset;
1004 /*--- End of included file: packet-ros-fn.c ---*/
1005 #line 370 "../../asn1/ros/packet-ros-template.c"
1008 * Dissect ROS PDUs inside a PPDU.
1010 static int
1011 dissect_ros(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data)
1013 int offset = 0;
1014 int old_offset;
1015 proto_item *item;
1016 proto_tree *tree;
1017 proto_tree *next_tree=NULL;
1018 conversation_t *conversation;
1019 ros_conv_info_t *ros_info = NULL;
1020 asn1_ctx_t asn1_ctx;
1021 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1023 /* save parent_tree so subdissectors can create new top nodes */
1024 top_tree=parent_tree;
1026 /* do we have application context from the acse dissector? */
1027 if( !data){
1028 if(parent_tree){
1029 proto_tree_add_text(parent_tree, tvb, offset, -1,
1030 "Internal error:can't get application context from ACSE dissector.");
1032 return 0;
1035 asn1_ctx.private_data = data;
1036 conversation = find_or_create_conversation(pinfo);
1039 * Do we already have our info
1041 ros_info = (ros_conv_info_t *)conversation_get_proto_data(conversation, proto_ros);
1042 if (ros_info == NULL) {
1044 /* No. Attach that information to the conversation. */
1046 ros_info = (ros_conv_info_t *)g_malloc(sizeof(ros_conv_info_t));
1047 ros_info->matched=g_hash_table_new(ros_info_hash_matched, ros_info_equal_matched);
1048 ros_info->unmatched=g_hash_table_new(ros_info_hash_unmatched, ros_info_equal_unmatched);
1050 conversation_add_proto_data(conversation, proto_ros, ros_info);
1052 ros_info->next = ros_info_items;
1053 ros_info_items = ros_info;
1056 item = proto_tree_add_item(parent_tree, proto_ros, tvb, 0, -1, ENC_NA);
1057 tree = proto_item_add_subtree(item, ett_ros);
1059 col_set_str(pinfo->cinfo, COL_PROTOCOL, "ROS");
1060 col_clear(pinfo->cinfo, COL_INFO);
1062 while (tvb_reported_length_remaining(tvb, offset) > 0){
1063 old_offset=offset;
1064 offset=dissect_ros_ROS(FALSE, tvb, offset, &asn1_ctx , tree, -1);
1065 if(offset == old_offset){
1066 item = proto_tree_add_text(tree, tvb, offset, -1,"Unknown ROS PDU");
1068 if(item){
1069 expert_add_info(pinfo, item, &ei_ros_unknown_ros_pdu);
1070 next_tree=proto_item_add_subtree(item, ett_ros_unknown);
1071 dissect_unknown_ber(pinfo, tvb, offset, next_tree);
1074 break;
1078 return tvb_length(tvb);
1081 static void
1082 ros_reinit(void)
1084 ros_conv_info_t *ros_info;
1086 /* Free up state attached to the ros_info structures */
1087 for (ros_info = ros_info_items; ros_info != NULL; ) {
1088 ros_conv_info_t *last;
1090 g_hash_table_destroy(ros_info->matched);
1091 ros_info->matched=NULL;
1092 g_hash_table_destroy(ros_info->unmatched);
1093 ros_info->unmatched=NULL;
1095 last = ros_info;
1096 ros_info = ros_info->next;
1097 g_free(last);
1100 ros_info_items = NULL;
1104 /*--- proto_register_ros -------------------------------------------*/
1105 void proto_register_ros(void) {
1107 /* List of fields */
1108 static hf_register_info hf[] =
1110 { &hf_ros_response_in,
1111 { "Response In", "ros.response_in",
1112 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
1113 "The response to this remote operation invocation is in this frame", HFILL }},
1114 { &hf_ros_response_to,
1115 { "Response To", "ros.response_to",
1116 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
1117 "This is a response to the remote operation invocation in this frame", HFILL }},
1118 { &hf_ros_time,
1119 { "Time", "ros.time",
1120 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
1121 "The time between the Invoke and the Response", HFILL }},
1124 /*--- Included file: packet-ros-hfarr.c ---*/
1125 #line 1 "../../asn1/ros/packet-ros-hfarr.c"
1126 { &hf_ros_invoke,
1127 { "invoke", "ros.invoke_element",
1128 FT_NONE, BASE_NONE, NULL, 0,
1129 NULL, HFILL }},
1130 { &hf_ros_returnResult,
1131 { "returnResult", "ros.returnResult_element",
1132 FT_NONE, BASE_NONE, NULL, 0,
1133 NULL, HFILL }},
1134 { &hf_ros_returnError,
1135 { "returnError", "ros.returnError_element",
1136 FT_NONE, BASE_NONE, NULL, 0,
1137 NULL, HFILL }},
1138 { &hf_ros_reject,
1139 { "reject", "ros.reject_element",
1140 FT_NONE, BASE_NONE, NULL, 0,
1141 NULL, HFILL }},
1142 { &hf_ros_bind_invoke,
1143 { "bind-invoke", "ros.bind_invoke_element",
1144 FT_NONE, BASE_NONE, NULL, 0,
1145 NULL, HFILL }},
1146 { &hf_ros_bind_result,
1147 { "bind-result", "ros.bind_result_element",
1148 FT_NONE, BASE_NONE, NULL, 0,
1149 NULL, HFILL }},
1150 { &hf_ros_bind_error,
1151 { "bind-error", "ros.bind_error_element",
1152 FT_NONE, BASE_NONE, NULL, 0,
1153 NULL, HFILL }},
1154 { &hf_ros_unbind_invoke,
1155 { "unbind-invoke", "ros.unbind_invoke_element",
1156 FT_NONE, BASE_NONE, NULL, 0,
1157 NULL, HFILL }},
1158 { &hf_ros_unbind_result,
1159 { "unbind-result", "ros.unbind_result_element",
1160 FT_NONE, BASE_NONE, NULL, 0,
1161 NULL, HFILL }},
1162 { &hf_ros_unbind_error,
1163 { "unbind-error", "ros.unbind_error_element",
1164 FT_NONE, BASE_NONE, NULL, 0,
1165 NULL, HFILL }},
1166 { &hf_ros_invokeId,
1167 { "invokeId", "ros.invokeId",
1168 FT_UINT32, BASE_DEC, VALS(ros_InvokeId_vals), 0,
1169 NULL, HFILL }},
1170 { &hf_ros_linkedId,
1171 { "linkedId", "ros.linkedId",
1172 FT_INT32, BASE_DEC, NULL, 0,
1173 "INTEGER", HFILL }},
1174 { &hf_ros_opcode,
1175 { "opcode", "ros.opcode",
1176 FT_INT32, BASE_DEC, NULL, 0,
1177 "OperationCode", HFILL }},
1178 { &hf_ros_argument,
1179 { "argument", "ros.argument_element",
1180 FT_NONE, BASE_NONE, NULL, 0,
1181 NULL, HFILL }},
1182 { &hf_ros_result,
1183 { "result", "ros.result_element",
1184 FT_NONE, BASE_NONE, NULL, 0,
1185 NULL, HFILL }},
1186 { &hf_ros_operationResult,
1187 { "result", "ros.result_element",
1188 FT_NONE, BASE_NONE, NULL, 0,
1189 "OperationResult", HFILL }},
1190 { &hf_ros_errcode,
1191 { "errcode", "ros.errcode",
1192 FT_INT32, BASE_DEC, NULL, 0,
1193 "ErrorCode", HFILL }},
1194 { &hf_ros_parameter,
1195 { "parameter", "ros.parameter_element",
1196 FT_NONE, BASE_NONE, NULL, 0,
1197 NULL, HFILL }},
1198 { &hf_ros_problem,
1199 { "problem", "ros.problem",
1200 FT_UINT32, BASE_DEC, VALS(ros_T_problem_vals), 0,
1201 NULL, HFILL }},
1202 { &hf_ros_general,
1203 { "general", "ros.general",
1204 FT_INT32, BASE_DEC, VALS(ros_GeneralProblem_vals), 0,
1205 "GeneralProblem", HFILL }},
1206 { &hf_ros_invokeProblem,
1207 { "invoke", "ros.invoke",
1208 FT_INT32, BASE_DEC, VALS(ros_InvokeProblem_vals), 0,
1209 "InvokeProblem", HFILL }},
1210 { &hf_ros_rejectResult,
1211 { "returnResult", "ros.returnResult",
1212 FT_INT32, BASE_DEC, VALS(ros_ReturnResultProblem_vals), 0,
1213 "ReturnResultProblem", HFILL }},
1214 { &hf_ros_rejectError,
1215 { "returnError", "ros.returnError",
1216 FT_INT32, BASE_DEC, VALS(ros_ReturnErrorProblem_vals), 0,
1217 "ReturnErrorProblem", HFILL }},
1218 { &hf_ros_present,
1219 { "present", "ros.present",
1220 FT_INT32, BASE_DEC, NULL, 0,
1221 NULL, HFILL }},
1222 { &hf_ros_absent,
1223 { "absent", "ros.absent_element",
1224 FT_NONE, BASE_NONE, NULL, 0,
1225 NULL, HFILL }},
1226 { &hf_ros_local,
1227 { "local", "ros.local",
1228 FT_INT32, BASE_DEC, NULL, 0,
1229 "INTEGER", HFILL }},
1230 { &hf_ros_global,
1231 { "global", "ros.global",
1232 FT_OID, BASE_NONE, NULL, 0,
1233 "OBJECT_IDENTIFIER", HFILL }},
1235 /*--- End of included file: packet-ros-hfarr.c ---*/
1236 #line 488 "../../asn1/ros/packet-ros-template.c"
1239 /* List of subtrees */
1240 static gint *ett[] = {
1241 &ett_ros,
1242 &ett_ros_unknown,
1244 /*--- Included file: packet-ros-ettarr.c ---*/
1245 #line 1 "../../asn1/ros/packet-ros-ettarr.c"
1246 &ett_ros_ROS,
1247 &ett_ros_Invoke,
1248 &ett_ros_ReturnResult,
1249 &ett_ros_T_result,
1250 &ett_ros_ReturnError,
1251 &ett_ros_Reject,
1252 &ett_ros_T_problem,
1253 &ett_ros_InvokeId,
1254 &ett_ros_Code,
1256 /*--- End of included file: packet-ros-ettarr.c ---*/
1257 #line 495 "../../asn1/ros/packet-ros-template.c"
1260 static ei_register_info ei[] = {
1261 { &ei_ros_dissector_oid_not_implemented, { "ros.dissector_oid_not_implemented", PI_UNDECODED, PI_WARN, "ROS: Dissector for OID not implemented", EXPFILL }},
1262 { &ei_ros_unknown_ros_pdu, { "ros.unknown_ros_pdu", PI_UNDECODED, PI_WARN, "Unknown ROS PDU", EXPFILL }},
1265 expert_module_t* expert_ros;
1267 /* Register protocol */
1268 proto_ros = proto_register_protocol(PNAME, PSNAME, PFNAME);
1269 new_register_dissector("ros", dissect_ros, proto_ros);
1270 /* Register fields and subtrees */
1271 proto_register_field_array(proto_ros, hf, array_length(hf));
1272 proto_register_subtree_array(ett, array_length(ett));
1273 expert_ros = expert_register_protocol(proto_ros);
1274 expert_register_field_array(expert_ros, ei, array_length(ei));
1276 ros_oid_dissector_table = register_dissector_table("ros.oid", "ROS OID Dissectors", FT_STRING, BASE_NONE);
1277 oid_table=g_hash_table_new(g_str_hash, g_str_equal);
1278 protocol_table=g_hash_table_new(g_str_hash, g_str_equal);
1280 ros_handle = find_dissector("ros");
1282 register_init_routine(ros_reinit);
1286 /*--- proto_reg_handoff_ros --- */
1287 void proto_reg_handoff_ros(void) {