Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-cosnaming.c
blob029c0b125511190247ccf15bab49aa155787fe69
1 /* packet-cosnaming.c
3 * Routines for IDL dissection
5 * Autogenerated from idl2wrs
6 * Copyright 2001 Frank Singleton <frank.singleton@ericsson.com>
7 */
11 * Wireshark - Network traffic analyzer
12 * By Gerald Combs <gerald@wireshark.org>
13 * Copyright 1998 Gerald Combs
17 * SPDX-License-Identifier: GPL-2.0-or-later
21 #include "config.h"
23 #include <string.h>
24 #include <epan/packet.h>
25 #include <epan/proto.h>
26 #include "packet-giop.h"
27 #include <epan/expert.h>
28 #include <wsutil/array.h>
30 #include "ws_diag_control.h"
31 #include "ws_compiler_tests.h"
33 #ifdef _MSC_VER
34 /* disable warning: "unreference local variable" */
35 #pragma warning(disable:4101)
36 #endif
38 /* XXX this should be autogenerated, or the warnings fixed in the generator */
39 DIAG_OFF(unused-function)
40 DIAG_OFF(unused-variable)
41 #if WS_IS_AT_LEAST_GNUC_VERSION(6,0)
42 DIAG_OFF(unused-const-variable)
43 #endif
45 void proto_register_giop_cosnaming(void);
46 void proto_reg_handoff_giop_cosnaming(void);
48 /* Initialise the protocol and subtree pointers */
49 static int proto_cosnaming;
50 static int ett_cosnaming;
51 static int ett_giop_struct;
52 static int ett_giop_sequence;
53 static int ett_giop_array;
54 static int ett_giop_union;
57 /* Initialise the initial Alignment */
58 static uint32_t boundary = GIOP_HEADER_SIZE; /* initial value */
60 static int hf_operationrequest;/* Request_Operation field */
62 /* Operation filters */
63 static int hf_CosNaming_BindingIterator_next_n_return;
64 static int hf_CosNaming_BindingIterator_next_n_how_many;
65 static int hf_CosNaming_BindingIterator_next_n_bl_loop;
66 static int hf_CosNaming_BindingIterator_next_one_return;
67 static int hf_CosNaming_NamingContext_list_how_many;
68 static int hf_CosNaming_NamingContext_list_bl_loop;
69 static int hf_CosNaming_NamingContext_bind_new_context_n_loop;
70 static int hf_CosNaming_NamingContext_unbind_n_loop;
71 static int hf_CosNaming_NamingContext_resolve_n_loop;
72 static int hf_CosNaming_NamingContext_rebind_context_n_loop;
73 static int hf_CosNaming_NamingContext_bind_context_n_loop;
74 static int hf_CosNaming_NamingContext_rebind_n_loop;
75 static int hf_CosNaming_NamingContext_bind_n_loop;
76 /* Struct filters */
77 static int hf_CosNaming_Binding_binding_name_loop;
78 static int hf_CosNaming_Binding_binding_type;
79 static int hf_CosNaming_NameComponent_id;
80 static int hf_CosNaming_NameComponent_kind;
81 /* User exception filters */
82 static int hf_CosNaming_NamingContext_NotFound_why;
83 static int hf_CosNaming_NamingContext_NotFound_rest_of_name_loop;
84 static int hf_CosNaming_NamingContext_CannotProceed_cxt;
85 static int hf_CosNaming_NamingContext_CannotProceed_rest_of_name_loop;
86 /* Expert info filters */
87 static expert_field ei_cosnaming_unknown_giop_msg;
88 static expert_field ei_cosnaming_unknown_exception;
89 static expert_field ei_cosnaming_unknown_reply_status;
92 static proto_tree *start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int *offset);
95 /* Struct prototype declaration Start */
97 /* Struct = IDL:omg.org/CosNaming/Binding:1.0 */
98 static void decode_CosNaming_Binding_st(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header _U_, const char *operation _U_, bool stream_is_big_endian _U_);
100 /* Struct = IDL:omg.org/CosNaming/NameComponent:1.0 */
101 static void decode_CosNaming_NameComponent_st(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header _U_, const char *operation _U_, bool stream_is_big_endian _U_);
103 /* Struct prototype declaration End */
106 * IDL Enums Start
110 * Enum = IDL:omg.org/CosNaming/NamingContext/NotFoundReason:1.0
112 static const value_string CosNaming_NamingContext_NotFoundReason[] = {
114 { 0, "missing_node" },
115 { 1, "not_context" },
116 { 2, "not_object" },
117 { 0, NULL },
121 * Enum = IDL:omg.org/CosNaming/BindingType:1.0
123 static const value_string CosNaming_BindingType[] = {
125 { 0, "nobject" },
126 { 1, "ncontext" },
127 { 0, NULL },
131 * IDL Enums End
134 /* Begin Exception Helper Functions */
137 /* Exception = IDL:omg.org/CosNaming/NamingContext/NotFound:1.0 */
138 static void
139 decode_ex_CosNaming_NamingContext_NotFound(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, const char *operation _U_, bool stream_is_big_endian _U_)
142 proto_item *item = wmem_new0(pinfo->pool, proto_item);
144 /* Operation specific Variable declarations Begin */
145 uint32_t u_octet4;
146 uint32_t u_octet4_loop_CosNaming_NamingContext_NotFound_rest_of_name;
147 uint32_t i_CosNaming_NamingContext_NotFound_rest_of_name;
148 /* Operation specific Variable declarations End */
150 u_octet4 = get_CDR_enum(tvb,offset,stream_is_big_endian, boundary);
151 proto_tree_add_uint(tree, hf_CosNaming_NamingContext_NotFound_why, tvb, *offset-4, 4, u_octet4);
153 u_octet4_loop_CosNaming_NamingContext_NotFound_rest_of_name = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
154 proto_tree_add_uint(tree, hf_CosNaming_NamingContext_NotFound_rest_of_name_loop, tvb,*offset-4, 4, u_octet4_loop_CosNaming_NamingContext_NotFound_rest_of_name);
157 proto_tree *tree_bak_09Tpe7TmnKrq = tree;
158 tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_sequence, NULL, "sequence CosNaming_NamingContext_NotFound_rest_of_name");
159 for (i_CosNaming_NamingContext_NotFound_rest_of_name=0; i_CosNaming_NamingContext_NotFound_rest_of_name < u_octet4_loop_CosNaming_NamingContext_NotFound_rest_of_name; i_CosNaming_NamingContext_NotFound_rest_of_name++) {
161 { /* Begin struct "CosNaming_NameComponent" */
162 proto_tree *struct_tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_struct, NULL, "struct CosNaming_NameComponent");
164 decode_CosNaming_NameComponent_st(tvb, pinfo, struct_tree, item, offset, header, operation, stream_is_big_endian);
165 } /* End struct "CosNaming_NameComponent" */
167 tree = tree_bak_09Tpe7TmnKrq;
172 /* Exception = IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0 */
173 static void
174 decode_ex_CosNaming_NamingContext_CannotProceed(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, const char *operation _U_, bool stream_is_big_endian _U_)
177 proto_item *item = wmem_new0(pinfo->pool, proto_item);
179 /* Operation specific Variable declarations Begin */
180 uint32_t u_octet4_loop_CosNaming_NamingContext_CannotProceed_rest_of_name;
181 uint32_t i_CosNaming_NamingContext_CannotProceed_rest_of_name;
182 /* Operation specific Variable declarations End */
184 get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);
186 u_octet4_loop_CosNaming_NamingContext_CannotProceed_rest_of_name = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
187 proto_tree_add_uint(tree, hf_CosNaming_NamingContext_CannotProceed_rest_of_name_loop, tvb,*offset-4, 4, u_octet4_loop_CosNaming_NamingContext_CannotProceed_rest_of_name);
190 proto_tree *tree_bak_JSHneL6pZlpo = tree;
191 tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_sequence, NULL, "sequence CosNaming_NamingContext_CannotProceed_rest_of_name");
192 for (i_CosNaming_NamingContext_CannotProceed_rest_of_name=0; i_CosNaming_NamingContext_CannotProceed_rest_of_name < u_octet4_loop_CosNaming_NamingContext_CannotProceed_rest_of_name; i_CosNaming_NamingContext_CannotProceed_rest_of_name++) {
194 { /* Begin struct "CosNaming_NameComponent" */
195 proto_tree *struct_tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_struct, NULL, "struct CosNaming_NameComponent");
197 decode_CosNaming_NameComponent_st(tvb, pinfo, struct_tree, item, offset, header, operation, stream_is_big_endian);
198 } /* End struct "CosNaming_NameComponent" */
200 tree = tree_bak_JSHneL6pZlpo;
206 /* End Exception Helper Functions */
209 * Main delegator for exception handling
212 static bool
213 decode_user_exception(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *ptree _U_, int *offset _U_, MessageHeader *header, const char *operation _U_, bool stream_is_big_endian _U_)
215 proto_tree *tree _U_;
217 if (!header->exception_id)
218 return false;
220 if (strcmp(header->exception_id, "IDL:omg.org/CosNaming/NamingContext/NotFound:1.0") == 0) {
221 tree = start_dissecting(tvb, pinfo, ptree, offset);
222 decode_ex_CosNaming_NamingContext_NotFound(tvb, pinfo, tree, offset, header, operation, stream_is_big_endian); /* IDL:omg.org/CosNaming/NamingContext/NotFound:1.0 */
223 return true;
226 if (strcmp(header->exception_id, "IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0") == 0) {
227 tree = start_dissecting(tvb, pinfo, ptree, offset);
228 decode_ex_CosNaming_NamingContext_CannotProceed(tvb, pinfo, tree, offset, header, operation, stream_is_big_endian); /* IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0 */
229 return true;
233 return false; /* user exception not found */
237 * IDL:omg.org/CosNaming/BindingIterator/destroy:1.0
239 static void
240 decode_CosNaming_BindingIterator_destroy(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header, const char *operation _U_, bool stream_is_big_endian _U_)
242 switch(header->message_type) {
243 case Request:
244 break;
245 case Reply:
246 switch(header->rep_status) {
247 case NO_EXCEPTION:
248 /* Function returns void */
250 break;
251 case USER_EXCEPTION:
252 break;
253 default:
254 /* Unknown Exception */
255 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_exception, "Unknown exception %d", header->rep_status);
256 break;
257 } /* switch(header->rep_status) */
259 break;
260 default:
261 /* Unknown GIOP Message */
262 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_giop_msg, "Unknown GIOP message %d", header->message_type);
263 break;
264 } /* switch(header->message_type) */
268 * IDL:omg.org/CosNaming/BindingIterator/next_n:1.0
270 static void
271 decode_CosNaming_BindingIterator_next_n(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header, const char *operation _U_, bool stream_is_big_endian _U_)
273 /* Operation specific Variable declarations Begin */
274 uint32_t u_octet4_loop_CosNaming_BindingIterator_next_n_bl;
275 uint32_t i_CosNaming_BindingIterator_next_n_bl;
276 /* Operation specific Variable declarations End */
278 switch(header->message_type) {
279 case Request:
280 proto_tree_add_uint(tree, hf_CosNaming_BindingIterator_next_n_how_many, tvb, *offset-4, 4, get_CDR_ulong(tvb,offset,stream_is_big_endian, boundary));
282 break;
283 case Reply:
284 switch(header->rep_status) {
285 case NO_EXCEPTION:
286 proto_tree_add_boolean(tree, hf_CosNaming_BindingIterator_next_n_return, tvb, *offset-1, 1, get_CDR_boolean(tvb,offset));
288 u_octet4_loop_CosNaming_BindingIterator_next_n_bl = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
289 proto_tree_add_uint(tree, hf_CosNaming_BindingIterator_next_n_bl_loop, tvb,*offset-4, 4, u_octet4_loop_CosNaming_BindingIterator_next_n_bl);
292 proto_tree *tree_bak_E4cwUte8TciR = tree;
293 tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_sequence, NULL, "sequence CosNaming_BindingIterator_next_n_bl");
294 for (i_CosNaming_BindingIterator_next_n_bl=0; i_CosNaming_BindingIterator_next_n_bl < u_octet4_loop_CosNaming_BindingIterator_next_n_bl; i_CosNaming_BindingIterator_next_n_bl++) {
296 { /* Begin struct "CosNaming_Binding" */
297 proto_tree *struct_tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_struct, NULL, "struct CosNaming_Binding");
299 decode_CosNaming_Binding_st(tvb, pinfo, struct_tree, item, offset, header, operation, stream_is_big_endian);
300 } /* End struct "CosNaming_Binding" */
302 tree = tree_bak_E4cwUte8TciR;
305 break;
306 case USER_EXCEPTION:
307 break;
308 default:
309 /* Unknown Exception */
310 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_exception, "Unknown exception %d", header->rep_status);
311 break;
312 } /* switch(header->rep_status) */
314 break;
315 default:
316 /* Unknown GIOP Message */
317 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_giop_msg, "Unknown GIOP message %d", header->message_type);
318 break;
319 } /* switch(header->message_type) */
323 * IDL:omg.org/CosNaming/BindingIterator/next_one:1.0
325 static void
326 decode_CosNaming_BindingIterator_next_one(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header, const char *operation _U_, bool stream_is_big_endian _U_)
328 switch(header->message_type) {
329 case Request:
330 break;
331 case Reply:
332 switch(header->rep_status) {
333 case NO_EXCEPTION:
334 proto_tree_add_boolean(tree, hf_CosNaming_BindingIterator_next_one_return, tvb, *offset-1, 1, get_CDR_boolean(tvb,offset));
336 { /* Begin struct "CosNaming_Binding" */
337 proto_tree *struct_tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_struct, NULL, "struct CosNaming_Binding");
339 decode_CosNaming_Binding_st(tvb, pinfo, struct_tree, item, offset, header, operation, stream_is_big_endian);
340 } /* End struct "CosNaming_Binding" */
341 break;
342 case USER_EXCEPTION:
343 break;
344 default:
345 /* Unknown Exception */
346 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_exception, "Unknown exception %d", header->rep_status);
347 break;
348 } /* switch(header->rep_status) */
350 break;
351 default:
352 /* Unknown GIOP Message */
353 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_giop_msg, "Unknown GIOP message %d", header->message_type);
354 break;
355 } /* switch(header->message_type) */
359 * IDL:omg.org/CosNaming/NamingContext/list:1.0
361 static void
362 decode_CosNaming_NamingContext_list(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header, const char *operation _U_, bool stream_is_big_endian _U_)
364 /* Operation specific Variable declarations Begin */
365 uint32_t u_octet4_loop_CosNaming_NamingContext_list_bl;
366 uint32_t i_CosNaming_NamingContext_list_bl;
367 /* Operation specific Variable declarations End */
369 switch(header->message_type) {
370 case Request:
371 proto_tree_add_uint(tree, hf_CosNaming_NamingContext_list_how_many, tvb, *offset-4, 4, get_CDR_ulong(tvb,offset,stream_is_big_endian, boundary));
373 break;
374 case Reply:
375 switch(header->rep_status) {
376 case NO_EXCEPTION:
377 /* Function returns void */
379 u_octet4_loop_CosNaming_NamingContext_list_bl = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
380 proto_tree_add_uint(tree, hf_CosNaming_NamingContext_list_bl_loop, tvb,*offset-4, 4, u_octet4_loop_CosNaming_NamingContext_list_bl);
383 proto_tree *tree_bak_5xFdi4agCjhj = tree;
384 tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_sequence, NULL, "sequence CosNaming_NamingContext_list_bl");
385 for (i_CosNaming_NamingContext_list_bl=0; i_CosNaming_NamingContext_list_bl < u_octet4_loop_CosNaming_NamingContext_list_bl; i_CosNaming_NamingContext_list_bl++) {
387 { /* Begin struct "CosNaming_Binding" */
388 proto_tree *struct_tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_struct, NULL, "struct CosNaming_Binding");
390 decode_CosNaming_Binding_st(tvb, pinfo, struct_tree, item, offset, header, operation, stream_is_big_endian);
391 } /* End struct "CosNaming_Binding" */
393 tree = tree_bak_5xFdi4agCjhj;
396 get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);
398 break;
399 case USER_EXCEPTION:
400 break;
401 default:
402 /* Unknown Exception */
403 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_exception, "Unknown exception %d", header->rep_status);
404 break;
405 } /* switch(header->rep_status) */
407 break;
408 default:
409 /* Unknown GIOP Message */
410 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_giop_msg, "Unknown GIOP message %d", header->message_type);
411 break;
412 } /* switch(header->message_type) */
416 * IDL:omg.org/CosNaming/NamingContext/destroy:1.0
418 static void
419 decode_CosNaming_NamingContext_destroy(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header, const char *operation _U_, bool stream_is_big_endian _U_)
421 switch(header->message_type) {
422 case Request:
423 break;
424 case Reply:
425 switch(header->rep_status) {
426 case NO_EXCEPTION:
427 /* Function returns void */
429 break;
430 case USER_EXCEPTION:
431 break;
432 default:
433 /* Unknown Exception */
434 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_exception, "Unknown exception %d", header->rep_status);
435 break;
436 } /* switch(header->rep_status) */
438 break;
439 default:
440 /* Unknown GIOP Message */
441 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_giop_msg, "Unknown GIOP message %d", header->message_type);
442 break;
443 } /* switch(header->message_type) */
447 * IDL:omg.org/CosNaming/NamingContext/bind_new_context:1.0
449 static void
450 decode_CosNaming_NamingContext_bind_new_context(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header, const char *operation _U_, bool stream_is_big_endian _U_)
452 /* Operation specific Variable declarations Begin */
453 uint32_t u_octet4_loop_CosNaming_NamingContext_bind_new_context_n;
454 uint32_t i_CosNaming_NamingContext_bind_new_context_n;
455 /* Operation specific Variable declarations End */
457 switch(header->message_type) {
458 case Request:
459 u_octet4_loop_CosNaming_NamingContext_bind_new_context_n = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
460 proto_tree_add_uint(tree, hf_CosNaming_NamingContext_bind_new_context_n_loop, tvb,*offset-4, 4, u_octet4_loop_CosNaming_NamingContext_bind_new_context_n);
463 proto_tree *tree_bak_EvONX2gOyah6 = tree;
464 tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_sequence, NULL, "sequence CosNaming_NamingContext_bind_new_context_n");
465 for (i_CosNaming_NamingContext_bind_new_context_n=0; i_CosNaming_NamingContext_bind_new_context_n < u_octet4_loop_CosNaming_NamingContext_bind_new_context_n; i_CosNaming_NamingContext_bind_new_context_n++) {
467 { /* Begin struct "CosNaming_NameComponent" */
468 proto_tree *struct_tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_struct, NULL, "struct CosNaming_NameComponent");
470 decode_CosNaming_NameComponent_st(tvb, pinfo, struct_tree, item, offset, header, operation, stream_is_big_endian);
471 } /* End struct "CosNaming_NameComponent" */
473 tree = tree_bak_EvONX2gOyah6;
476 break;
477 case Reply:
478 switch(header->rep_status) {
479 case NO_EXCEPTION:
480 get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);
482 break;
483 case USER_EXCEPTION:
484 break;
485 default:
486 /* Unknown Exception */
487 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_exception, "Unknown exception %d", header->rep_status);
488 break;
489 } /* switch(header->rep_status) */
491 break;
492 default:
493 /* Unknown GIOP Message */
494 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_giop_msg, "Unknown GIOP message %d", header->message_type);
495 break;
496 } /* switch(header->message_type) */
500 * IDL:omg.org/CosNaming/NamingContext/new_context:1.0
502 static void
503 decode_CosNaming_NamingContext_new_context(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header, const char *operation _U_, bool stream_is_big_endian _U_)
505 switch(header->message_type) {
506 case Request:
507 break;
508 case Reply:
509 switch(header->rep_status) {
510 case NO_EXCEPTION:
511 get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);
513 break;
514 case USER_EXCEPTION:
515 break;
516 default:
517 /* Unknown Exception */
518 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_exception, "Unknown exception %d", header->rep_status);
519 break;
520 } /* switch(header->rep_status) */
522 break;
523 default:
524 /* Unknown GIOP Message */
525 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_giop_msg, "Unknown GIOP message %d", header->message_type);
526 break;
527 } /* switch(header->message_type) */
531 * IDL:omg.org/CosNaming/NamingContext/unbind:1.0
533 static void
534 decode_CosNaming_NamingContext_unbind(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header, const char *operation _U_, bool stream_is_big_endian _U_)
536 /* Operation specific Variable declarations Begin */
537 uint32_t u_octet4_loop_CosNaming_NamingContext_unbind_n;
538 uint32_t i_CosNaming_NamingContext_unbind_n;
539 /* Operation specific Variable declarations End */
541 switch(header->message_type) {
542 case Request:
543 u_octet4_loop_CosNaming_NamingContext_unbind_n = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
544 proto_tree_add_uint(tree, hf_CosNaming_NamingContext_unbind_n_loop, tvb,*offset-4, 4, u_octet4_loop_CosNaming_NamingContext_unbind_n);
547 proto_tree *tree_bak_5uqRsRwEVFim = tree;
548 tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_sequence, NULL, "sequence CosNaming_NamingContext_unbind_n");
549 for (i_CosNaming_NamingContext_unbind_n=0; i_CosNaming_NamingContext_unbind_n < u_octet4_loop_CosNaming_NamingContext_unbind_n; i_CosNaming_NamingContext_unbind_n++) {
551 { /* Begin struct "CosNaming_NameComponent" */
552 proto_tree *struct_tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_struct, NULL, "struct CosNaming_NameComponent");
554 decode_CosNaming_NameComponent_st(tvb, pinfo, struct_tree, item, offset, header, operation, stream_is_big_endian);
555 } /* End struct "CosNaming_NameComponent" */
557 tree = tree_bak_5uqRsRwEVFim;
560 break;
561 case Reply:
562 switch(header->rep_status) {
563 case NO_EXCEPTION:
564 /* Function returns void */
566 break;
567 case USER_EXCEPTION:
568 break;
569 default:
570 /* Unknown Exception */
571 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_exception, "Unknown exception %d", header->rep_status);
572 break;
573 } /* switch(header->rep_status) */
575 break;
576 default:
577 /* Unknown GIOP Message */
578 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_giop_msg, "Unknown GIOP message %d", header->message_type);
579 break;
580 } /* switch(header->message_type) */
584 * IDL:omg.org/CosNaming/NamingContext/resolve:1.0
586 static void
587 decode_CosNaming_NamingContext_resolve(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header, const char *operation _U_, bool stream_is_big_endian _U_)
589 /* Operation specific Variable declarations Begin */
590 uint32_t u_octet4_loop_CosNaming_NamingContext_resolve_n;
591 uint32_t i_CosNaming_NamingContext_resolve_n;
592 /* Operation specific Variable declarations End */
594 switch(header->message_type) {
595 case Request:
596 u_octet4_loop_CosNaming_NamingContext_resolve_n = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
597 proto_tree_add_uint(tree, hf_CosNaming_NamingContext_resolve_n_loop, tvb,*offset-4, 4, u_octet4_loop_CosNaming_NamingContext_resolve_n);
600 proto_tree *tree_bak_RKEfOtemf4os = tree;
601 tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_sequence, NULL, "sequence CosNaming_NamingContext_resolve_n");
602 for (i_CosNaming_NamingContext_resolve_n=0; i_CosNaming_NamingContext_resolve_n < u_octet4_loop_CosNaming_NamingContext_resolve_n; i_CosNaming_NamingContext_resolve_n++) {
604 { /* Begin struct "CosNaming_NameComponent" */
605 proto_tree *struct_tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_struct, NULL, "struct CosNaming_NameComponent");
607 decode_CosNaming_NameComponent_st(tvb, pinfo, struct_tree, item, offset, header, operation, stream_is_big_endian);
608 } /* End struct "CosNaming_NameComponent" */
610 tree = tree_bak_RKEfOtemf4os;
613 break;
614 case Reply:
615 switch(header->rep_status) {
616 case NO_EXCEPTION:
617 get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);
619 break;
620 case USER_EXCEPTION:
621 break;
622 default:
623 /* Unknown Exception */
624 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_exception, "Unknown exception %d", header->rep_status);
625 break;
626 } /* switch(header->rep_status) */
628 break;
629 default:
630 /* Unknown GIOP Message */
631 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_giop_msg, "Unknown GIOP message %d", header->message_type);
632 break;
633 } /* switch(header->message_type) */
637 * IDL:omg.org/CosNaming/NamingContext/rebind_context:1.0
639 static void
640 decode_CosNaming_NamingContext_rebind_context(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header, const char *operation _U_, bool stream_is_big_endian _U_)
642 /* Operation specific Variable declarations Begin */
643 uint32_t u_octet4_loop_CosNaming_NamingContext_rebind_context_n;
644 uint32_t i_CosNaming_NamingContext_rebind_context_n;
645 /* Operation specific Variable declarations End */
647 switch(header->message_type) {
648 case Request:
649 u_octet4_loop_CosNaming_NamingContext_rebind_context_n = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
650 proto_tree_add_uint(tree, hf_CosNaming_NamingContext_rebind_context_n_loop, tvb,*offset-4, 4, u_octet4_loop_CosNaming_NamingContext_rebind_context_n);
653 proto_tree *tree_bak_9TQVabcmASYc = tree;
654 tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_sequence, NULL, "sequence CosNaming_NamingContext_rebind_context_n");
655 for (i_CosNaming_NamingContext_rebind_context_n=0; i_CosNaming_NamingContext_rebind_context_n < u_octet4_loop_CosNaming_NamingContext_rebind_context_n; i_CosNaming_NamingContext_rebind_context_n++) {
657 { /* Begin struct "CosNaming_NameComponent" */
658 proto_tree *struct_tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_struct, NULL, "struct CosNaming_NameComponent");
660 decode_CosNaming_NameComponent_st(tvb, pinfo, struct_tree, item, offset, header, operation, stream_is_big_endian);
661 } /* End struct "CosNaming_NameComponent" */
663 tree = tree_bak_9TQVabcmASYc;
666 get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);
668 break;
669 case Reply:
670 switch(header->rep_status) {
671 case NO_EXCEPTION:
672 /* Function returns void */
674 break;
675 case USER_EXCEPTION:
676 break;
677 default:
678 /* Unknown Exception */
679 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_exception, "Unknown exception %d", header->rep_status);
680 break;
681 } /* switch(header->rep_status) */
683 break;
684 default:
685 /* Unknown GIOP Message */
686 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_giop_msg, "Unknown GIOP message %d", header->message_type);
687 break;
688 } /* switch(header->message_type) */
692 * IDL:omg.org/CosNaming/NamingContext/bind_context:1.0
694 static void
695 decode_CosNaming_NamingContext_bind_context(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header, const char *operation _U_, bool stream_is_big_endian _U_)
697 /* Operation specific Variable declarations Begin */
698 uint32_t u_octet4_loop_CosNaming_NamingContext_bind_context_n;
699 uint32_t i_CosNaming_NamingContext_bind_context_n;
700 /* Operation specific Variable declarations End */
702 switch(header->message_type) {
703 case Request:
704 u_octet4_loop_CosNaming_NamingContext_bind_context_n = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
705 proto_tree_add_uint(tree, hf_CosNaming_NamingContext_bind_context_n_loop, tvb,*offset-4, 4, u_octet4_loop_CosNaming_NamingContext_bind_context_n);
708 proto_tree *tree_bak_s91VIl9VUpG1 = tree;
709 tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_sequence, NULL, "sequence CosNaming_NamingContext_bind_context_n");
710 for (i_CosNaming_NamingContext_bind_context_n=0; i_CosNaming_NamingContext_bind_context_n < u_octet4_loop_CosNaming_NamingContext_bind_context_n; i_CosNaming_NamingContext_bind_context_n++) {
712 { /* Begin struct "CosNaming_NameComponent" */
713 proto_tree *struct_tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_struct, NULL, "struct CosNaming_NameComponent");
715 decode_CosNaming_NameComponent_st(tvb, pinfo, struct_tree, item, offset, header, operation, stream_is_big_endian);
716 } /* End struct "CosNaming_NameComponent" */
718 tree = tree_bak_s91VIl9VUpG1;
721 get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);
723 break;
724 case Reply:
725 switch(header->rep_status) {
726 case NO_EXCEPTION:
727 /* Function returns void */
729 break;
730 case USER_EXCEPTION:
731 break;
732 default:
733 /* Unknown Exception */
734 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_exception, "Unknown exception %d", header->rep_status);
735 break;
736 } /* switch(header->rep_status) */
738 break;
739 default:
740 /* Unknown GIOP Message */
741 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_giop_msg, "Unknown GIOP message %d", header->message_type);
742 break;
743 } /* switch(header->message_type) */
747 * IDL:omg.org/CosNaming/NamingContext/rebind:1.0
749 static void
750 decode_CosNaming_NamingContext_rebind(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header, const char *operation _U_, bool stream_is_big_endian _U_)
752 /* Operation specific Variable declarations Begin */
753 uint32_t u_octet4_loop_CosNaming_NamingContext_rebind_n;
754 uint32_t i_CosNaming_NamingContext_rebind_n;
755 /* Operation specific Variable declarations End */
757 switch(header->message_type) {
758 case Request:
759 u_octet4_loop_CosNaming_NamingContext_rebind_n = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
760 proto_tree_add_uint(tree, hf_CosNaming_NamingContext_rebind_n_loop, tvb,*offset-4, 4, u_octet4_loop_CosNaming_NamingContext_rebind_n);
763 proto_tree *tree_bak_UWooUkg0Qqpj = tree;
764 tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_sequence, NULL, "sequence CosNaming_NamingContext_rebind_n");
765 for (i_CosNaming_NamingContext_rebind_n=0; i_CosNaming_NamingContext_rebind_n < u_octet4_loop_CosNaming_NamingContext_rebind_n; i_CosNaming_NamingContext_rebind_n++) {
767 { /* Begin struct "CosNaming_NameComponent" */
768 proto_tree *struct_tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_struct, NULL, "struct CosNaming_NameComponent");
770 decode_CosNaming_NameComponent_st(tvb, pinfo, struct_tree, item, offset, header, operation, stream_is_big_endian);
771 } /* End struct "CosNaming_NameComponent" */
773 tree = tree_bak_UWooUkg0Qqpj;
776 get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);
778 break;
779 case Reply:
780 switch(header->rep_status) {
781 case NO_EXCEPTION:
782 /* Function returns void */
784 break;
785 case USER_EXCEPTION:
786 break;
787 default:
788 /* Unknown Exception */
789 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_exception, "Unknown exception %d", header->rep_status);
790 break;
791 } /* switch(header->rep_status) */
793 break;
794 default:
795 /* Unknown GIOP Message */
796 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_giop_msg, "Unknown GIOP message %d", header->message_type);
797 break;
798 } /* switch(header->message_type) */
802 * IDL:omg.org/CosNaming/NamingContext/bind:1.0
804 static void
805 decode_CosNaming_NamingContext_bind(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header, const char *operation _U_, bool stream_is_big_endian _U_)
807 /* Operation specific Variable declarations Begin */
808 uint32_t u_octet4_loop_CosNaming_NamingContext_bind_n;
809 uint32_t i_CosNaming_NamingContext_bind_n;
810 /* Operation specific Variable declarations End */
812 switch(header->message_type) {
813 case Request:
814 u_octet4_loop_CosNaming_NamingContext_bind_n = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
815 proto_tree_add_uint(tree, hf_CosNaming_NamingContext_bind_n_loop, tvb,*offset-4, 4, u_octet4_loop_CosNaming_NamingContext_bind_n);
818 proto_tree *tree_bak_3nWkRtOzQey4 = tree;
819 tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_sequence, NULL, "sequence CosNaming_NamingContext_bind_n");
820 for (i_CosNaming_NamingContext_bind_n=0; i_CosNaming_NamingContext_bind_n < u_octet4_loop_CosNaming_NamingContext_bind_n; i_CosNaming_NamingContext_bind_n++) {
822 { /* Begin struct "CosNaming_NameComponent" */
823 proto_tree *struct_tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_struct, NULL, "struct CosNaming_NameComponent");
825 decode_CosNaming_NameComponent_st(tvb, pinfo, struct_tree, item, offset, header, operation, stream_is_big_endian);
826 } /* End struct "CosNaming_NameComponent" */
828 tree = tree_bak_3nWkRtOzQey4;
831 get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);
833 break;
834 case Reply:
835 switch(header->rep_status) {
836 case NO_EXCEPTION:
837 /* Function returns void */
839 break;
840 case USER_EXCEPTION:
841 break;
842 default:
843 /* Unknown Exception */
844 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_exception, "Unknown exception %d", header->rep_status);
845 break;
846 } /* switch(header->rep_status) */
848 break;
849 default:
850 /* Unknown GIOP Message */
851 expert_add_info_format(pinfo, item, &ei_cosnaming_unknown_giop_msg, "Unknown GIOP message %d", header->message_type);
852 break;
853 } /* switch(header->message_type) */
856 /* Struct = IDL:omg.org/CosNaming/Binding:1.0 */
857 static void
858 decode_CosNaming_Binding_st(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header _U_, const char *operation _U_, bool stream_is_big_endian _U_)
861 /* Operation specific Variable declarations Begin */
862 uint32_t u_octet4_loop_CosNaming_Binding_binding_name;
863 uint32_t i_CosNaming_Binding_binding_name;
864 uint32_t u_octet4;
865 /* Operation specific Variable declarations End */
867 u_octet4_loop_CosNaming_Binding_binding_name = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
868 proto_tree_add_uint(tree, hf_CosNaming_Binding_binding_name_loop, tvb,*offset-4, 4, u_octet4_loop_CosNaming_Binding_binding_name);
871 proto_tree *tree_bak_pYEBTg0SDLpl = tree;
872 tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_sequence, NULL, "sequence CosNaming_Binding_binding_name");
873 for (i_CosNaming_Binding_binding_name=0; i_CosNaming_Binding_binding_name < u_octet4_loop_CosNaming_Binding_binding_name; i_CosNaming_Binding_binding_name++) {
875 { /* Begin struct "CosNaming_NameComponent" */
876 proto_tree *struct_tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ett_giop_struct, NULL, "struct CosNaming_NameComponent");
878 decode_CosNaming_NameComponent_st(tvb, pinfo, struct_tree, item, offset, header, operation, stream_is_big_endian);
879 } /* End struct "CosNaming_NameComponent" */
881 tree = tree_bak_pYEBTg0SDLpl;
884 u_octet4 = get_CDR_enum(tvb,offset,stream_is_big_endian, boundary);
885 proto_tree_add_uint(tree, hf_CosNaming_Binding_binding_type, tvb, *offset-4, 4, u_octet4);
889 /* Struct = IDL:omg.org/CosNaming/NameComponent:1.0 */
890 static void
891 decode_CosNaming_NameComponent_st(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header _U_, const char *operation _U_, bool stream_is_big_endian _U_)
894 giop_add_CDR_string(tree, tvb, offset, stream_is_big_endian, boundary, hf_CosNaming_NameComponent_id);
896 giop_add_CDR_string(tree, tvb, offset, stream_is_big_endian, boundary, hf_CosNaming_NameComponent_kind);
901 * Called once we accept the packet as being for us; it sets the
902 * Protocol and Info columns and creates the top-level protocol
903 * tree item.
905 static proto_tree *
906 start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int *offset)
909 proto_item *ti = NULL;
910 proto_tree *tree = NULL; /* init later, inside if(tree) */
912 col_set_str(pinfo->cinfo, COL_PROTOCOL, "COSNAMING");
915 * Do not clear COL_INFO, as nothing is being written there by
916 * this dissector yet. So leave it as is from the GIOP dissector.
917 * TODO: add something useful to COL_INFO
918 * col_clear(pinfo->cinfo, COL_INFO);
921 if (ptree) {
922 ti = proto_tree_add_item(ptree, proto_cosnaming, tvb, *offset, tvb_reported_length_remaining(tvb, *offset), ENC_NA);
923 tree = proto_item_add_subtree(ti, ett_cosnaming);
925 return tree;
928 static proto_item*
929 process_RequestOperation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, MessageHeader *header, const char *operation)
931 proto_item *pi;
932 if(header->message_type == Reply) {
933 /* fill-up info column */
934 col_append_fstr(pinfo->cinfo, COL_INFO, " op = %s",operation);
936 /* fill-up the field */
937 pi=proto_tree_add_string(ptree, hf_operationrequest, tvb, 0, 0, operation);
938 proto_item_set_generated(pi);
939 return pi;
942 static bool
943 dissect_cosnaming(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int *offset, MessageHeader *header, const char *operation, char *idlname)
945 proto_item *item _U_;
946 proto_tree *tree _U_;
947 bool stream_is_big_endian = is_big_endian(header); /* get endianess */
949 /* If we have a USER Exception, then decode it and return */
950 if ((header->message_type == Reply) && (header->rep_status == USER_EXCEPTION)) {
951 return decode_user_exception(tvb, pinfo, ptree, offset, header, operation, stream_is_big_endian);
954 switch(header->message_type) {
956 case Request:
957 case Reply:
959 if (strcmp(operation, "destroy") == 0
960 && (!idlname || strcmp(idlname, "CosNaming/BindingIterator") == 0)) {
961 item = process_RequestOperation(tvb, pinfo, ptree, header, operation); /* fill-up Request_Operation field & info column */
962 tree = start_dissecting(tvb, pinfo, ptree, offset);
963 decode_CosNaming_BindingIterator_destroy(tvb, pinfo, tree, item, offset, header, operation, stream_is_big_endian);
964 return true;
967 if (strcmp(operation, "next_n") == 0
968 && (!idlname || strcmp(idlname, "CosNaming/BindingIterator") == 0)) {
969 item = process_RequestOperation(tvb, pinfo, ptree, header, operation); /* fill-up Request_Operation field & info column */
970 tree = start_dissecting(tvb, pinfo, ptree, offset);
971 decode_CosNaming_BindingIterator_next_n(tvb, pinfo, tree, item, offset, header, operation, stream_is_big_endian);
972 return true;
975 if (strcmp(operation, "next_one") == 0
976 && (!idlname || strcmp(idlname, "CosNaming/BindingIterator") == 0)) {
977 item = process_RequestOperation(tvb, pinfo, ptree, header, operation); /* fill-up Request_Operation field & info column */
978 tree = start_dissecting(tvb, pinfo, ptree, offset);
979 decode_CosNaming_BindingIterator_next_one(tvb, pinfo, tree, item, offset, header, operation, stream_is_big_endian);
980 return true;
983 if (strcmp(operation, "list") == 0
984 && (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
985 item = process_RequestOperation(tvb, pinfo, ptree, header, operation); /* fill-up Request_Operation field & info column */
986 tree = start_dissecting(tvb, pinfo, ptree, offset);
987 decode_CosNaming_NamingContext_list(tvb, pinfo, tree, item, offset, header, operation, stream_is_big_endian);
988 return true;
991 if (strcmp(operation, "destroy") == 0
992 && (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
993 item = process_RequestOperation(tvb, pinfo, ptree, header, operation); /* fill-up Request_Operation field & info column */
994 tree = start_dissecting(tvb, pinfo, ptree, offset);
995 decode_CosNaming_NamingContext_destroy(tvb, pinfo, tree, item, offset, header, operation, stream_is_big_endian);
996 return true;
999 if (strcmp(operation, "bind_new_context") == 0
1000 && (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
1001 item = process_RequestOperation(tvb, pinfo, ptree, header, operation); /* fill-up Request_Operation field & info column */
1002 tree = start_dissecting(tvb, pinfo, ptree, offset);
1003 decode_CosNaming_NamingContext_bind_new_context(tvb, pinfo, tree, item, offset, header, operation, stream_is_big_endian);
1004 return true;
1007 if (strcmp(operation, "new_context") == 0
1008 && (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
1009 item = process_RequestOperation(tvb, pinfo, ptree, header, operation); /* fill-up Request_Operation field & info column */
1010 tree = start_dissecting(tvb, pinfo, ptree, offset);
1011 decode_CosNaming_NamingContext_new_context(tvb, pinfo, tree, item, offset, header, operation, stream_is_big_endian);
1012 return true;
1015 if (strcmp(operation, "unbind") == 0
1016 && (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
1017 item = process_RequestOperation(tvb, pinfo, ptree, header, operation); /* fill-up Request_Operation field & info column */
1018 tree = start_dissecting(tvb, pinfo, ptree, offset);
1019 decode_CosNaming_NamingContext_unbind(tvb, pinfo, tree, item, offset, header, operation, stream_is_big_endian);
1020 return true;
1023 if (strcmp(operation, "resolve") == 0
1024 && (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
1025 item = process_RequestOperation(tvb, pinfo, ptree, header, operation); /* fill-up Request_Operation field & info column */
1026 tree = start_dissecting(tvb, pinfo, ptree, offset);
1027 decode_CosNaming_NamingContext_resolve(tvb, pinfo, tree, item, offset, header, operation, stream_is_big_endian);
1028 return true;
1031 if (strcmp(operation, "rebind_context") == 0
1032 && (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
1033 item = process_RequestOperation(tvb, pinfo, ptree, header, operation); /* fill-up Request_Operation field & info column */
1034 tree = start_dissecting(tvb, pinfo, ptree, offset);
1035 decode_CosNaming_NamingContext_rebind_context(tvb, pinfo, tree, item, offset, header, operation, stream_is_big_endian);
1036 return true;
1039 if (strcmp(operation, "bind_context") == 0
1040 && (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
1041 item = process_RequestOperation(tvb, pinfo, ptree, header, operation); /* fill-up Request_Operation field & info column */
1042 tree = start_dissecting(tvb, pinfo, ptree, offset);
1043 decode_CosNaming_NamingContext_bind_context(tvb, pinfo, tree, item, offset, header, operation, stream_is_big_endian);
1044 return true;
1047 if (strcmp(operation, "rebind") == 0
1048 && (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
1049 item = process_RequestOperation(tvb, pinfo, ptree, header, operation); /* fill-up Request_Operation field & info column */
1050 tree = start_dissecting(tvb, pinfo, ptree, offset);
1051 decode_CosNaming_NamingContext_rebind(tvb, pinfo, tree, item, offset, header, operation, stream_is_big_endian);
1052 return true;
1055 if (strcmp(operation, "bind") == 0
1056 && (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
1057 item = process_RequestOperation(tvb, pinfo, ptree, header, operation); /* fill-up Request_Operation field & info column */
1058 tree = start_dissecting(tvb, pinfo, ptree, offset);
1059 decode_CosNaming_NamingContext_bind(tvb, pinfo, tree, item, offset, header, operation, stream_is_big_endian);
1060 return true;
1063 break;
1065 case CancelRequest:
1066 case LocateRequest:
1067 case LocateReply:
1068 case CloseConnection:
1069 case MessageError:
1070 case Fragment:
1071 return false; /* not handled yet */
1073 default:
1074 return false; /* not handled yet */
1076 } /* switch */
1079 return false;
1081 } /* End of main dissector */
1084 /* Register the protocol with Wireshark */
1085 void proto_register_giop_cosnaming(void)
1087 /* setup list of header fields */
1088 static hf_register_info hf[] = {
1089 /* field that indicates the currently ongoing request/reply exchange */
1090 {&hf_operationrequest, {"Request_Operation","giop-cosnaming.Request_Operation",FT_STRING,BASE_NONE,NULL,0x0,NULL,HFILL}},
1091 /* Operation filters */
1092 {&hf_CosNaming_BindingIterator_next_n_return, {"Return value","giop-cosnaming.BindingIterator.next_n.return",FT_BOOLEAN,8,NULL,0x01,NULL,HFILL}},
1093 {&hf_CosNaming_BindingIterator_next_n_how_many, {"how_many","giop-cosnaming.BindingIterator.next_n.how_many",FT_UINT32,BASE_DEC,NULL,0x0,NULL,HFILL}},
1094 {&hf_CosNaming_BindingIterator_next_n_bl_loop, {"Seq length of bl","giop-cosnaming.BindingIterator.next_n.bl.size",FT_UINT32,BASE_DEC,NULL,0x0,NULL,HFILL}},
1095 {&hf_CosNaming_BindingIterator_next_one_return, {"Return value","giop-cosnaming.BindingIterator.next_one.return",FT_BOOLEAN,8,NULL,0x01,NULL,HFILL}},
1096 {&hf_CosNaming_NamingContext_list_how_many, {"how_many","giop-cosnaming.NamingContext.list.how_many",FT_UINT32,BASE_DEC,NULL,0x0,NULL,HFILL}},
1097 {&hf_CosNaming_NamingContext_list_bl_loop, {"Seq length of bl","giop-cosnaming.NamingContext.list.bl.size",FT_UINT32,BASE_DEC,NULL,0x0,NULL,HFILL}},
1098 {&hf_CosNaming_NamingContext_bind_new_context_n_loop, {"Seq length of n","giop-cosnaming.NamingContext.bind_new_context.n.size",FT_UINT32,BASE_DEC,NULL,0x0,NULL,HFILL}},
1099 {&hf_CosNaming_NamingContext_unbind_n_loop, {"Seq length of n","giop-cosnaming.NamingContext.unbind.n.size",FT_UINT32,BASE_DEC,NULL,0x0,NULL,HFILL}},
1100 {&hf_CosNaming_NamingContext_resolve_n_loop, {"Seq length of n","giop-cosnaming.NamingContext.resolve.n.size",FT_UINT32,BASE_DEC,NULL,0x0,NULL,HFILL}},
1101 {&hf_CosNaming_NamingContext_rebind_context_n_loop, {"Seq length of n","giop-cosnaming.NamingContext.rebind_context.n.size",FT_UINT32,BASE_DEC,NULL,0x0,NULL,HFILL}},
1102 {&hf_CosNaming_NamingContext_bind_context_n_loop, {"Seq length of n","giop-cosnaming.NamingContext.bind_context.n.size",FT_UINT32,BASE_DEC,NULL,0x0,NULL,HFILL}},
1103 {&hf_CosNaming_NamingContext_rebind_n_loop, {"Seq length of n","giop-cosnaming.NamingContext.rebind.n.size",FT_UINT32,BASE_DEC,NULL,0x0,NULL,HFILL}},
1104 {&hf_CosNaming_NamingContext_bind_n_loop, {"Seq length of n","giop-cosnaming.NamingContext.bind.n.size",FT_UINT32,BASE_DEC,NULL,0x0,NULL,HFILL}},
1105 /* Attribute filters */
1106 /* Struct filters */
1107 {&hf_CosNaming_Binding_binding_name_loop, {"Seq length of Binding_binding_name","giop-cosnaming.Binding.binding_name.size",FT_UINT32,BASE_DEC,NULL,0x0,NULL,HFILL}},
1108 {&hf_CosNaming_Binding_binding_type, {"Binding_binding_type","giop-cosnaming.Binding.binding_type",FT_UINT32,BASE_DEC,VALS(CosNaming_BindingType),0x0,NULL,HFILL}},
1109 {&hf_CosNaming_NameComponent_id, {"NameComponent_id","giop-cosnaming.NameComponent.id",FT_STRING,BASE_NONE,NULL,0x0,NULL,HFILL}},
1110 {&hf_CosNaming_NameComponent_kind, {"NameComponent_kind","giop-cosnaming.NameComponent.kind",FT_STRING,BASE_NONE,NULL,0x0,NULL,HFILL}},
1111 /* User exception filters */
1112 {&hf_CosNaming_NamingContext_NotFound_why, {"NotFound_why","giop-cosnaming.NamingContext.NotFound_why",FT_UINT32,BASE_DEC,VALS(CosNaming_NamingContext_NotFoundReason),0x0,NULL,HFILL}},
1113 {&hf_CosNaming_NamingContext_NotFound_rest_of_name_loop, {"Seq length of NotFound_rest_of_name","giop-cosnaming.NamingContext.NotFound_rest_of_name.size",FT_UINT32,BASE_DEC,NULL,0x0,NULL,HFILL}},
1114 {&hf_CosNaming_NamingContext_CannotProceed_rest_of_name_loop, {"Seq length of CannotProceed_rest_of_name","giop-cosnaming.NamingContext.CannotProceed_rest_of_name.size",FT_UINT32,BASE_DEC,NULL,0x0,NULL,HFILL}},
1115 /* Union filters */
1119 static ei_register_info ei[] = {
1120 { &ei_cosnaming_unknown_giop_msg, { "giop-cosnaming.unknown_giop_msg", PI_PROTOCOL, PI_WARN, "Unknown GIOP message", EXPFILL }},
1121 { &ei_cosnaming_unknown_exception, { "giop-cosnaming.unknown_exception", PI_PROTOCOL, PI_WARN, "Unknown exception", EXPFILL }},
1122 { &ei_cosnaming_unknown_reply_status, { "giop-cosnaming.unknown_reply_status", PI_PROTOCOL, PI_WARN, "Unknown reply status", EXPFILL }},
1125 /* setup protocol subtree array */
1127 static int *ett[] = {
1128 &ett_cosnaming,
1129 &ett_giop_struct,
1130 &ett_giop_sequence,
1131 &ett_giop_array,
1132 &ett_giop_union,
1135 expert_module_t* expert_cosnaming;
1138 /* Register the protocol name and description */
1139 proto_cosnaming = proto_register_protocol("Cosnaming Dissector Using GIOP API" , "GIOP/COSNAMING", "giop-cosnaming" );
1140 proto_register_field_array(proto_cosnaming, hf, array_length(hf));
1141 proto_register_subtree_array(ett, array_length(ett));
1143 expert_cosnaming = expert_register_protocol(proto_cosnaming);
1144 expert_register_field_array(expert_cosnaming, ei, array_length(ei));
1147 /* register me as handler for these interfaces */
1148 void proto_reg_handoff_giop_cosnaming(void)
1150 /* Register for Explicit Dissection */
1151 register_giop_user_module(dissect_cosnaming, "COSNAMING", "CosNaming/BindingIterator", proto_cosnaming ); /* explicit dissector */
1153 /* Register for Explicit Dissection */
1154 register_giop_user_module(dissect_cosnaming, "COSNAMING", "CosNaming/NamingContext", proto_cosnaming ); /* explicit dissector */
1156 /* Register for Heuristic Dissection */
1157 register_giop_user(dissect_cosnaming, "COSNAMING" ,proto_cosnaming); /* heuristic dissector */
1162 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1164 * Local Variables:
1165 * c-basic-offset: 4
1166 * tab-width: 8
1167 * indent-tabs-mode: nil
1168 * End:
1170 * ex: set shiftwidth=4 tabstop=8 expandtab:
1171 * :indentSize=4:tabSize=8:noTabs=true: