Don't dereference pointer before checking for NULL
[obnox/wireshark/wip.git] / plugins / giop / packet-cosnaming.c
1 /* packet-cosnaming.c
2  *
3  * $Id$
4  *
5  * Routines for IDL dissection
6  *
7  * Autogenerated from idl2wrs
8  * Copyright 2001 Frank Singleton <frank.singleton@ericsson.com>
9  */
10
11
12 /*
13  * Wireshark - Network traffic analyzer
14  * By Gerald Combs
15  * Copyright 1999 Gerald Combs
16  */
17
18
19 /*
20  * This program is free software; you can redistribute it and/or
21  * modify it under the terms of the GNU General Public License
22  * as published by the Free Software Foundation; either version 2
23  * of the License, or (at your option) any later version.
24  *
25  * This program is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28  * GNU General Public License for more details.
29  *
30  * You should have received a copy of the GNU General Public License
31  * along with this program; if not, write to the Free Software
32  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
33  */
34
35
36 #ifdef HAVE_CONFIG_H
37 # include "config.h"
38 #endif
39
40 #include <stdio.h>
41 #include <stdlib.h>
42 #include <gmodule.h>
43
44 #include <string.h>
45 #include <glib.h>
46 #include <epan/packet.h>
47 #include <epan/proto.h>
48 #include <epan/dissectors/packet-giop.h>
49
50 #ifndef ENABLE_STATIC
51 G_MODULE_EXPORT const gchar version[] = "0.0.1";
52 #endif
53
54 #ifdef _MSC_VER
55 /* disable warning: "unreference local variable" */
56 #pragma warning(disable:4101)
57 #endif
58
59 static proto_tree *start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int *offset);
60
61
62
63 /* Struct prototype declaration Start */
64
65
66
67
68 /* Struct = IDL:omg.org/CosNaming/NameComponent:1.0 */
69
70 static void decode_CosNaming_NameComponent_st(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_);
71
72
73
74
75 /* Struct = IDL:omg.org/CosNaming/Binding:1.0 */
76
77 static void decode_CosNaming_Binding_st(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_);
78
79
80
81 /* Struct prototype declaration End */
82
83
84
85 /* Union prototype declaration Start */
86
87
88
89 /* Union prototype declaration End */
90
91
92
93 /* Initialise the protocol and subtree pointers */
94
95 static int proto_cosnaming = -1;
96
97 static gint ett_cosnaming = -1;
98
99
100
101 /* Initialise the initial Alignment */
102
103 static guint32  boundary = GIOP_HEADER_SIZE;  /* initial value */
104
105
106
107
108 /* Initialise the Registered fields */
109
110 /* TODO - Use registered fields */
111
112
113 /*
114  * IDL Operations Start
115  */
116
117  
118 static const char CosNaming_NamingContext_bind_op[] = "bind" ;
119 static const char CosNaming_NamingContext_rebind_op[] = "rebind" ;
120 static const char CosNaming_NamingContext_bind_context_op[] = "bind_context" ;
121 static const char CosNaming_NamingContext_rebind_context_op[] = "rebind_context" ;
122 static const char CosNaming_NamingContext_resolve_op[] = "resolve" ;
123 static const char CosNaming_NamingContext_unbind_op[] = "unbind" ;
124 static const char CosNaming_NamingContext_new_context_op[] = "new_context" ;
125 static const char CosNaming_NamingContext_bind_new_context_op[] = "bind_new_context" ;
126 static const char CosNaming_NamingContext_destroy_op[] = "destroy" ;
127 static const char CosNaming_NamingContext_list_op[] = "list" ;
128 static const char CosNaming_BindingIterator_next_one_op[] = "next_one" ;
129 static const char CosNaming_BindingIterator_next_n_op[] = "next_n" ;
130 static const char CosNaming_BindingIterator_destroy_op[] = "destroy" ;
131
132 /*
133  * IDL Operations End
134  */
135
136
137 /*  Begin Exception (containing members) String  Declare  */
138
139
140 static const char user_exception_CosNaming_NamingContext_NotFound[] = "IDL:omg.org/CosNaming/NamingContext/NotFound:1.0" ; 
141 static const char user_exception_CosNaming_NamingContext_CannotProceed[] = "IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0" ; 
142
143 /*  End Exception (containing members) String Declare  */
144
145
146 /*
147  * IDL Attributes Start
148  */
149
150  
151
152 /*
153  * IDL Attributes End
154  */
155
156
157 /*
158  * IDL Enums Start
159  */
160
161  
162 /*
163  * Enum = IDL:omg.org/CosNaming/BindingType:1.0
164  */
165
166  
167 static const value_string CosNaming_BindingType[] = {
168
169    { 0, "nobject" }, 
170    { 1, "ncontext" }, 
171    { 0,       NULL },
172 };
173
174
175 /*
176  * Enum = IDL:omg.org/CosNaming/NamingContext/NotFoundReason:1.0
177  */
178
179  
180 static const value_string CosNaming_NamingContext_NotFoundReason[] = {
181
182    { 0, "missing_node" }, 
183    { 1, "not_context" }, 
184    { 2, "not_object" }, 
185    { 0,       NULL },
186 };
187
188
189 /*
190  * IDL Enums End
191  */
192
193  
194 /*  Begin Exception Helper Functions  */
195
196
197
198 /* Exception = IDL:omg.org/CosNaming/NamingContext/NotFound:1.0 */
199
200 static void decode_ex_CosNaming_NamingContext_NotFound(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_) {
201
202     gboolean stream_is_big_endian;          /* big endianess */
203
204     
205     /* Operation specific Variable declarations Begin */
206
207     guint32   u_octet4;
208     guint32   u_octet4_loop_NotFound_rest_of_name;
209     guint32   i_NotFound_rest_of_name;
210     
211     /* Operation specific Variable declarations End */
212
213     
214     stream_is_big_endian = is_big_endian(header);  /* get stream endianess */
215
216
217     
218     u_octet4 = get_CDR_enum(tvb,offset,stream_is_big_endian, boundary);
219     if (tree) {
220        proto_tree_add_text(tree,tvb,*offset-4,4,"Enum value = %u (%s)",u_octet4,val_to_str(u_octet4,CosNaming_NamingContext_NotFoundReason,"Unknown Enum Value"));
221     }
222
223     u_octet4_loop_NotFound_rest_of_name = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
224     if (tree) {
225        proto_tree_add_text(tree,tvb,*offset-4, 4 ,"Seq length of NotFound_rest_of_name = %u",u_octet4_loop_NotFound_rest_of_name);
226     }
227
228     for (i_NotFound_rest_of_name=0; i_NotFound_rest_of_name < u_octet4_loop_NotFound_rest_of_name; i_NotFound_rest_of_name++) {
229
230         /*  Begin struct "CosNaming_NameComponent"  */
231
232         
233
234         decode_CosNaming_NameComponent_st(tvb, pinfo, tree, offset, header, operation);
235
236
237         /*  End struct "CosNaming_NameComponent"  */
238
239     }
240
241 }
242
243
244 /* Exception = IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0 */
245
246 static void decode_ex_CosNaming_NamingContext_CannotProceed(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_) {
247
248     gboolean stream_is_big_endian;          /* big endianess */
249
250     
251     /* Operation specific Variable declarations Begin */
252
253     guint32   u_octet4_loop_CannotProceed_rest_of_name;
254     guint32   i_CannotProceed_rest_of_name;
255     
256     /* Operation specific Variable declarations End */
257
258     
259     stream_is_big_endian = is_big_endian(header);  /* get stream endianess */
260
261
262     get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);
263
264
265     u_octet4_loop_CannotProceed_rest_of_name = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
266     if (tree) {
267        proto_tree_add_text(tree,tvb,*offset-4, 4 ,"Seq length of CannotProceed_rest_of_name = %u",u_octet4_loop_CannotProceed_rest_of_name);
268     }
269
270     for (i_CannotProceed_rest_of_name=0; i_CannotProceed_rest_of_name < u_octet4_loop_CannotProceed_rest_of_name; i_CannotProceed_rest_of_name++) {
271
272         /*  Begin struct "CosNaming_NameComponent"  */
273
274         
275
276         decode_CosNaming_NameComponent_st(tvb, pinfo, tree, offset, header, operation);
277
278
279         /*  End struct "CosNaming_NameComponent"  */
280
281     }
282
283 }
284
285
286 /*  End Exception Helper Functions  */
287
288
289
290 /*
291  * Main delegator for exception handling
292  *
293  */
294
295 static gboolean decode_user_exception(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *ptree _U_, int *offset _U_, MessageHeader *header, gchar *operation _U_ ) {
296
297     gboolean be _U_;                        /* big endianess */
298     proto_tree *tree _U_;
299
300     if (!header->exception_id)
301         return FALSE;
302
303
304     if (strcmp(header->exception_id, user_exception_CosNaming_NamingContext_NotFound) == 0) {
305        tree = start_dissecting(tvb, pinfo, ptree, offset);
306        decode_ex_CosNaming_NamingContext_NotFound(tvb, pinfo, tree, offset, header, operation);   /*  IDL:omg.org/CosNaming/NamingContext/NotFound:1.0  */
307        return TRUE;
308     }
309
310
311     if (strcmp(header->exception_id, user_exception_CosNaming_NamingContext_CannotProceed) == 0) {
312        tree = start_dissecting(tvb, pinfo, ptree, offset);
313        decode_ex_CosNaming_NamingContext_CannotProceed(tvb, pinfo, tree, offset, header, operation);   /*  IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0  */
314        return TRUE;
315     }
316
317
318
319
320     return FALSE;    /* user exception not found */
321
322 }
323
324
325 /*  Begin Attribute Helper Functions  */
326
327
328
329 /*  End Attribute Helper Functions  */
330
331
332
333 /*
334  * IDL:omg.org/CosNaming/NamingContext/bind:1.0
335  */
336
337
338 static void decode_CosNaming_NamingContext_bind(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header, gchar *operation _U_) {
339
340     gboolean stream_is_big_endian;          /* big endianess */
341
342     
343     /* Operation specific Variable declarations Begin */
344
345     guint32   u_octet4_loop_n;
346     guint32   i_n;
347     
348     /* Operation specific Variable declarations End */
349
350     
351     stream_is_big_endian = is_big_endian(header);
352
353     switch(header->message_type) {
354
355     case Request:
356
357         u_octet4_loop_n = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
358         if (tree) {
359            proto_tree_add_text(tree,tvb,*offset-4, 4 ,"Seq length of n = %u",u_octet4_loop_n);
360         }
361
362         for (i_n=0; i_n < u_octet4_loop_n; i_n++) {
363
364             /*  Begin struct "CosNaming_NameComponent"  */
365
366             
367
368             decode_CosNaming_NameComponent_st(tvb, pinfo, tree, offset, header, operation);
369
370
371             /*  End struct "CosNaming_NameComponent"  */
372
373         }
374
375         get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);
376
377
378         break;
379
380     case Reply:
381
382         switch(header->rep_status) {
383
384         case NO_EXCEPTION:
385
386             
387             /* Function returns void */
388
389
390             break;
391
392         case USER_EXCEPTION:
393
394             break;
395
396         default:
397
398             /* Unknown Exception */
399
400             g_warning("Unknown Exception ");
401
402
403
404             break;
405
406         
407         }   /* switch(header->message_type) */
408
409         break;
410
411     default:
412
413         /* Unknown GIOP Message */
414
415         g_warning("Unknown GIOP Message");
416
417
418         break;
419
420     
421     } /* switch(header->message_type) */
422
423 }
424
425
426 /*
427  * IDL:omg.org/CosNaming/NamingContext/rebind:1.0
428  */
429
430
431 static void decode_CosNaming_NamingContext_rebind(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header, gchar *operation _U_) {
432
433     gboolean stream_is_big_endian;          /* big endianess */
434
435     
436     /* Operation specific Variable declarations Begin */
437
438     guint32   u_octet4_loop_n;
439     guint32   i_n;
440     
441     /* Operation specific Variable declarations End */
442
443     
444     stream_is_big_endian = is_big_endian(header);
445
446     switch(header->message_type) {
447
448     case Request:
449
450         u_octet4_loop_n = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
451         if (tree) {
452            proto_tree_add_text(tree,tvb,*offset-4, 4 ,"Seq length of n = %u",u_octet4_loop_n);
453         }
454
455         for (i_n=0; i_n < u_octet4_loop_n; i_n++) {
456
457             /*  Begin struct "CosNaming_NameComponent"  */
458
459             
460
461             decode_CosNaming_NameComponent_st(tvb, pinfo, tree, offset, header, operation);
462
463
464             /*  End struct "CosNaming_NameComponent"  */
465
466         }
467
468         get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);
469
470
471         break;
472
473     case Reply:
474
475         switch(header->rep_status) {
476
477         case NO_EXCEPTION:
478
479             
480             /* Function returns void */
481
482
483             break;
484
485         case USER_EXCEPTION:
486
487             break;
488
489         default:
490
491             /* Unknown Exception */
492
493             g_warning("Unknown Exception ");
494
495
496
497             break;
498
499         
500         }   /* switch(header->message_type) */
501
502         break;
503
504     default:
505
506         /* Unknown GIOP Message */
507
508         g_warning("Unknown GIOP Message");
509
510
511         break;
512
513     
514     } /* switch(header->message_type) */
515
516 }
517
518
519 /*
520  * IDL:omg.org/CosNaming/NamingContext/bind_context:1.0
521  */
522
523
524 static void decode_CosNaming_NamingContext_bind_context(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header, gchar *operation _U_) {
525
526     gboolean stream_is_big_endian;          /* big endianess */
527
528     
529     /* Operation specific Variable declarations Begin */
530
531     guint32   u_octet4_loop_n;
532     guint32   i_n;
533     
534     /* Operation specific Variable declarations End */
535
536     
537     stream_is_big_endian = is_big_endian(header);
538
539     switch(header->message_type) {
540
541     case Request:
542
543         u_octet4_loop_n = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
544         if (tree) {
545            proto_tree_add_text(tree,tvb,*offset-4, 4 ,"Seq length of n = %u",u_octet4_loop_n);
546         }
547
548         for (i_n=0; i_n < u_octet4_loop_n; i_n++) {
549
550             /*  Begin struct "CosNaming_NameComponent"  */
551
552             
553
554             decode_CosNaming_NameComponent_st(tvb, pinfo, tree, offset, header, operation);
555
556
557             /*  End struct "CosNaming_NameComponent"  */
558
559         }
560
561         get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);
562
563
564         break;
565
566     case Reply:
567
568         switch(header->rep_status) {
569
570         case NO_EXCEPTION:
571
572             
573             /* Function returns void */
574
575
576             break;
577
578         case USER_EXCEPTION:
579
580             break;
581
582         default:
583
584             /* Unknown Exception */
585
586             g_warning("Unknown Exception ");
587
588
589
590             break;
591
592         
593         }   /* switch(header->message_type) */
594
595         break;
596
597     default:
598
599         /* Unknown GIOP Message */
600
601         g_warning("Unknown GIOP Message");
602
603
604         break;
605
606     
607     } /* switch(header->message_type) */
608
609 }
610
611
612 /*
613  * IDL:omg.org/CosNaming/NamingContext/rebind_context:1.0
614  */
615
616
617 static void decode_CosNaming_NamingContext_rebind_context(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header, gchar *operation _U_) {
618
619     gboolean stream_is_big_endian;          /* big endianess */
620
621     
622     /* Operation specific Variable declarations Begin */
623
624     guint32   u_octet4_loop_n;
625     guint32   i_n;
626     
627     /* Operation specific Variable declarations End */
628
629     
630     stream_is_big_endian = is_big_endian(header);
631
632     switch(header->message_type) {
633
634     case Request:
635
636         u_octet4_loop_n = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
637         if (tree) {
638            proto_tree_add_text(tree,tvb,*offset-4, 4 ,"Seq length of n = %u",u_octet4_loop_n);
639         }
640
641         for (i_n=0; i_n < u_octet4_loop_n; i_n++) {
642
643             /*  Begin struct "CosNaming_NameComponent"  */
644
645             
646
647             decode_CosNaming_NameComponent_st(tvb, pinfo, tree, offset, header, operation);
648
649
650             /*  End struct "CosNaming_NameComponent"  */
651
652         }
653
654         get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);
655
656
657         break;
658
659     case Reply:
660
661         switch(header->rep_status) {
662
663         case NO_EXCEPTION:
664
665             
666             /* Function returns void */
667
668
669             break;
670
671         case USER_EXCEPTION:
672
673             break;
674
675         default:
676
677             /* Unknown Exception */
678
679             g_warning("Unknown Exception ");
680
681
682
683             break;
684
685         
686         }   /* switch(header->message_type) */
687
688         break;
689
690     default:
691
692         /* Unknown GIOP Message */
693
694         g_warning("Unknown GIOP Message");
695
696
697         break;
698
699     
700     } /* switch(header->message_type) */
701
702 }
703
704
705 /*
706  * IDL:omg.org/CosNaming/NamingContext/resolve:1.0
707  */
708
709
710 static void decode_CosNaming_NamingContext_resolve(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header, gchar *operation _U_) {
711
712     gboolean stream_is_big_endian;          /* big endianess */
713
714     
715     /* Operation specific Variable declarations Begin */
716
717     guint32   u_octet4_loop_n;
718     guint32   i_n;
719     
720     /* Operation specific Variable declarations End */
721
722     
723     stream_is_big_endian = is_big_endian(header);
724
725     switch(header->message_type) {
726
727     case Request:
728
729         u_octet4_loop_n = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
730         if (tree) {
731            proto_tree_add_text(tree,tvb,*offset-4, 4 ,"Seq length of n = %u",u_octet4_loop_n);
732         }
733
734         for (i_n=0; i_n < u_octet4_loop_n; i_n++) {
735
736             /*  Begin struct "CosNaming_NameComponent"  */
737
738             
739
740             decode_CosNaming_NameComponent_st(tvb, pinfo, tree, offset, header, operation);
741
742
743             /*  End struct "CosNaming_NameComponent"  */
744
745         }
746
747         break;
748
749     case Reply:
750
751         switch(header->rep_status) {
752
753         case NO_EXCEPTION:
754
755             get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);
756
757
758             break;
759
760         case USER_EXCEPTION:
761
762             break;
763
764         default:
765
766             /* Unknown Exception */
767
768             g_warning("Unknown Exception ");
769
770
771
772             break;
773
774         
775         }   /* switch(header->message_type) */
776
777         break;
778
779     default:
780
781         /* Unknown GIOP Message */
782
783         g_warning("Unknown GIOP Message");
784
785
786         break;
787
788     
789     } /* switch(header->message_type) */
790
791 }
792
793
794 /*
795  * IDL:omg.org/CosNaming/NamingContext/unbind:1.0
796  */
797
798
799 static void decode_CosNaming_NamingContext_unbind(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header, gchar *operation _U_) {
800
801     gboolean stream_is_big_endian;          /* big endianess */
802
803     
804     /* Operation specific Variable declarations Begin */
805
806     guint32   u_octet4_loop_n;
807     guint32   i_n;
808     
809     /* Operation specific Variable declarations End */
810
811     
812     stream_is_big_endian = is_big_endian(header);
813
814     switch(header->message_type) {
815
816     case Request:
817
818         u_octet4_loop_n = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
819         if (tree) {
820            proto_tree_add_text(tree,tvb,*offset-4, 4 ,"Seq length of n = %u",u_octet4_loop_n);
821         }
822
823         for (i_n=0; i_n < u_octet4_loop_n; i_n++) {
824
825             /*  Begin struct "CosNaming_NameComponent"  */
826
827             
828
829             decode_CosNaming_NameComponent_st(tvb, pinfo, tree, offset, header, operation);
830
831
832             /*  End struct "CosNaming_NameComponent"  */
833
834         }
835
836         break;
837
838     case Reply:
839
840         switch(header->rep_status) {
841
842         case NO_EXCEPTION:
843
844             
845             /* Function returns void */
846
847
848             break;
849
850         case USER_EXCEPTION:
851
852             break;
853
854         default:
855
856             /* Unknown Exception */
857
858             g_warning("Unknown Exception ");
859
860
861
862             break;
863
864         
865         }   /* switch(header->message_type) */
866
867         break;
868
869     default:
870
871         /* Unknown GIOP Message */
872
873         g_warning("Unknown GIOP Message");
874
875
876         break;
877
878     
879     } /* switch(header->message_type) */
880
881 }
882
883
884 /*
885  * IDL:omg.org/CosNaming/NamingContext/new_context:1.0
886  */
887
888
889 static void decode_CosNaming_NamingContext_new_context(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header, gchar *operation _U_) {
890
891     gboolean stream_is_big_endian;          /* big endianess */
892
893     
894     /* Operation specific Variable declarations Begin */
895
896     
897     /* Operation specific Variable declarations End */
898
899     
900     stream_is_big_endian = is_big_endian(header);
901
902     switch(header->message_type) {
903
904     case Request:
905
906         break;
907
908     case Reply:
909
910         switch(header->rep_status) {
911
912         case NO_EXCEPTION:
913
914             get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);
915
916
917             break;
918
919         case USER_EXCEPTION:
920
921             break;
922
923         default:
924
925             /* Unknown Exception */
926
927             g_warning("Unknown Exception ");
928
929
930
931             break;
932
933         
934         }   /* switch(header->message_type) */
935
936         break;
937
938     default:
939
940         /* Unknown GIOP Message */
941
942         g_warning("Unknown GIOP Message");
943
944
945         break;
946
947     
948     } /* switch(header->message_type) */
949
950 }
951
952
953 /*
954  * IDL:omg.org/CosNaming/NamingContext/bind_new_context:1.0
955  */
956
957
958 static void decode_CosNaming_NamingContext_bind_new_context(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header, gchar *operation _U_) {
959
960     gboolean stream_is_big_endian;          /* big endianess */
961
962     
963     /* Operation specific Variable declarations Begin */
964
965     guint32   u_octet4_loop_n;
966     guint32   i_n;
967     
968     /* Operation specific Variable declarations End */
969
970     
971     stream_is_big_endian = is_big_endian(header);
972
973     switch(header->message_type) {
974
975     case Request:
976
977         u_octet4_loop_n = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
978         if (tree) {
979            proto_tree_add_text(tree,tvb,*offset-4, 4 ,"Seq length of n = %u",u_octet4_loop_n);
980         }
981
982         for (i_n=0; i_n < u_octet4_loop_n; i_n++) {
983
984             /*  Begin struct "CosNaming_NameComponent"  */
985
986             
987
988             decode_CosNaming_NameComponent_st(tvb, pinfo, tree, offset, header, operation);
989
990
991             /*  End struct "CosNaming_NameComponent"  */
992
993         }
994
995         break;
996
997     case Reply:
998
999         switch(header->rep_status) {
1000
1001         case NO_EXCEPTION:
1002
1003             get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);
1004
1005
1006             break;
1007
1008         case USER_EXCEPTION:
1009
1010             break;
1011
1012         default:
1013
1014             /* Unknown Exception */
1015
1016             g_warning("Unknown Exception ");
1017
1018
1019
1020             break;
1021
1022         
1023         }   /* switch(header->message_type) */
1024
1025         break;
1026
1027     default:
1028
1029         /* Unknown GIOP Message */
1030
1031         g_warning("Unknown GIOP Message");
1032
1033
1034         break;
1035
1036     
1037     } /* switch(header->message_type) */
1038
1039 }
1040
1041
1042 /*
1043  * IDL:omg.org/CosNaming/NamingContext/destroy:1.0
1044  */
1045
1046
1047 static void decode_CosNaming_NamingContext_destroy(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header, gchar *operation _U_) {
1048
1049     gboolean stream_is_big_endian;          /* big endianess */
1050
1051     
1052     /* Operation specific Variable declarations Begin */
1053
1054     
1055     /* Operation specific Variable declarations End */
1056
1057     
1058     stream_is_big_endian = is_big_endian(header);
1059
1060     switch(header->message_type) {
1061
1062     case Request:
1063
1064         break;
1065
1066     case Reply:
1067
1068         switch(header->rep_status) {
1069
1070         case NO_EXCEPTION:
1071
1072             
1073             /* Function returns void */
1074
1075
1076             break;
1077
1078         case USER_EXCEPTION:
1079
1080             break;
1081
1082         default:
1083
1084             /* Unknown Exception */
1085
1086             g_warning("Unknown Exception ");
1087
1088
1089
1090             break;
1091
1092         
1093         }   /* switch(header->message_type) */
1094
1095         break;
1096
1097     default:
1098
1099         /* Unknown GIOP Message */
1100
1101         g_warning("Unknown GIOP Message");
1102
1103
1104         break;
1105
1106     
1107     } /* switch(header->message_type) */
1108
1109 }
1110
1111
1112 /*
1113  * IDL:omg.org/CosNaming/NamingContext/list:1.0
1114  */
1115
1116
1117 static void decode_CosNaming_NamingContext_list(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header, gchar *operation _U_) {
1118
1119     gboolean stream_is_big_endian;          /* big endianess */
1120
1121     
1122     /* Operation specific Variable declarations Begin */
1123
1124     guint32   u_octet4;
1125     guint32   u_octet4_loop_bl;
1126     guint32   i_bl;
1127     
1128     /* Operation specific Variable declarations End */
1129
1130     
1131     stream_is_big_endian = is_big_endian(header);
1132
1133     switch(header->message_type) {
1134
1135     case Request:
1136
1137         u_octet4 = get_CDR_ulong(tvb,offset,stream_is_big_endian, boundary);
1138         if (tree) {
1139            proto_tree_add_text(tree,tvb,*offset-4,4,"how_many = %u",u_octet4);
1140         }
1141
1142         break;
1143
1144     case Reply:
1145
1146         switch(header->rep_status) {
1147
1148         case NO_EXCEPTION:
1149
1150             
1151             /* Function returns void */
1152
1153
1154             u_octet4_loop_bl = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
1155             if (tree) {
1156                proto_tree_add_text(tree,tvb,*offset-4, 4 ,"Seq length of bl = %u",u_octet4_loop_bl);
1157             }
1158
1159             for (i_bl=0; i_bl < u_octet4_loop_bl; i_bl++) {
1160
1161                 /*  Begin struct "CosNaming_Binding"  */
1162
1163                 
1164
1165                 decode_CosNaming_Binding_st(tvb, pinfo, tree, offset, header, operation);
1166
1167
1168                 /*  End struct "CosNaming_Binding"  */
1169
1170             }
1171
1172             get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);
1173
1174
1175             break;
1176
1177         case USER_EXCEPTION:
1178
1179             break;
1180
1181         default:
1182
1183             /* Unknown Exception */
1184
1185             g_warning("Unknown Exception ");
1186
1187
1188
1189             break;
1190
1191         
1192         }   /* switch(header->message_type) */
1193
1194         break;
1195
1196     default:
1197
1198         /* Unknown GIOP Message */
1199
1200         g_warning("Unknown GIOP Message");
1201
1202
1203         break;
1204
1205     
1206     } /* switch(header->message_type) */
1207
1208 }
1209
1210
1211 /*
1212  * IDL:omg.org/CosNaming/BindingIterator/next_one:1.0
1213  */
1214
1215
1216 static void decode_CosNaming_BindingIterator_next_one(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header, gchar *operation _U_) {
1217
1218     gboolean stream_is_big_endian;          /* big endianess */
1219
1220     
1221     /* Operation specific Variable declarations Begin */
1222
1223     guint8    u_octet1;
1224     
1225     /* Operation specific Variable declarations End */
1226
1227     
1228     stream_is_big_endian = is_big_endian(header);
1229
1230     switch(header->message_type) {
1231
1232     case Request:
1233
1234         break;
1235
1236     case Reply:
1237
1238         switch(header->rep_status) {
1239
1240         case NO_EXCEPTION:
1241
1242             u_octet1 = get_CDR_boolean(tvb,offset);
1243             if (tree) {
1244                proto_tree_add_text(tree,tvb,*offset-1,1,"Operation_Return_Value = %u",u_octet1);
1245             }
1246
1247             /*  Begin struct "CosNaming_Binding"  */
1248
1249             
1250
1251             decode_CosNaming_Binding_st(tvb, pinfo, tree, offset, header, operation);
1252
1253
1254             /*  End struct "CosNaming_Binding"  */
1255
1256             break;
1257
1258         case USER_EXCEPTION:
1259
1260             break;
1261
1262         default:
1263
1264             /* Unknown Exception */
1265
1266             g_warning("Unknown Exception ");
1267
1268
1269
1270             break;
1271
1272         
1273         }   /* switch(header->message_type) */
1274
1275         break;
1276
1277     default:
1278
1279         /* Unknown GIOP Message */
1280
1281         g_warning("Unknown GIOP Message");
1282
1283
1284         break;
1285
1286     
1287     } /* switch(header->message_type) */
1288
1289 }
1290
1291
1292 /*
1293  * IDL:omg.org/CosNaming/BindingIterator/next_n:1.0
1294  */
1295
1296
1297 static void decode_CosNaming_BindingIterator_next_n(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header, gchar *operation _U_) {
1298
1299     gboolean stream_is_big_endian;          /* big endianess */
1300
1301     
1302     /* Operation specific Variable declarations Begin */
1303
1304     guint32   u_octet4;
1305     guint8    u_octet1;
1306     guint32   u_octet4_loop_bl;
1307     guint32   i_bl;
1308     
1309     /* Operation specific Variable declarations End */
1310
1311     
1312     stream_is_big_endian = is_big_endian(header);
1313
1314     switch(header->message_type) {
1315
1316     case Request:
1317
1318         u_octet4 = get_CDR_ulong(tvb,offset,stream_is_big_endian, boundary);
1319         if (tree) {
1320            proto_tree_add_text(tree,tvb,*offset-4,4,"how_many = %u",u_octet4);
1321         }
1322
1323         break;
1324
1325     case Reply:
1326
1327         switch(header->rep_status) {
1328
1329         case NO_EXCEPTION:
1330
1331             u_octet1 = get_CDR_boolean(tvb,offset);
1332             if (tree) {
1333                proto_tree_add_text(tree,tvb,*offset-1,1,"Operation_Return_Value = %u",u_octet1);
1334             }
1335
1336             u_octet4_loop_bl = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
1337             if (tree) {
1338                proto_tree_add_text(tree,tvb,*offset-4, 4 ,"Seq length of bl = %u",u_octet4_loop_bl);
1339             }
1340
1341             for (i_bl=0; i_bl < u_octet4_loop_bl; i_bl++) {
1342
1343                 /*  Begin struct "CosNaming_Binding"  */
1344
1345                 
1346
1347                 decode_CosNaming_Binding_st(tvb, pinfo, tree, offset, header, operation);
1348
1349
1350                 /*  End struct "CosNaming_Binding"  */
1351
1352             }
1353
1354             break;
1355
1356         case USER_EXCEPTION:
1357
1358             break;
1359
1360         default:
1361
1362             /* Unknown Exception */
1363
1364             g_warning("Unknown Exception ");
1365
1366
1367
1368             break;
1369
1370         
1371         }   /* switch(header->message_type) */
1372
1373         break;
1374
1375     default:
1376
1377         /* Unknown GIOP Message */
1378
1379         g_warning("Unknown GIOP Message");
1380
1381
1382         break;
1383
1384     
1385     } /* switch(header->message_type) */
1386
1387 }
1388
1389
1390 /*
1391  * IDL:omg.org/CosNaming/BindingIterator/destroy:1.0
1392  */
1393
1394
1395 static void decode_CosNaming_BindingIterator_destroy(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header, gchar *operation _U_) {
1396
1397     gboolean stream_is_big_endian;          /* big endianess */
1398
1399     
1400     /* Operation specific Variable declarations Begin */
1401
1402     
1403     /* Operation specific Variable declarations End */
1404
1405     
1406     stream_is_big_endian = is_big_endian(header);
1407
1408     switch(header->message_type) {
1409
1410     case Request:
1411
1412         break;
1413
1414     case Reply:
1415
1416         switch(header->rep_status) {
1417
1418         case NO_EXCEPTION:
1419
1420             
1421             /* Function returns void */
1422
1423
1424             break;
1425
1426         case USER_EXCEPTION:
1427
1428             break;
1429
1430         default:
1431
1432             /* Unknown Exception */
1433
1434             g_warning("Unknown Exception ");
1435
1436
1437
1438             break;
1439
1440         
1441         }   /* switch(header->message_type) */
1442
1443         break;
1444
1445     default:
1446
1447         /* Unknown GIOP Message */
1448
1449         g_warning("Unknown GIOP Message");
1450
1451
1452         break;
1453
1454     
1455     } /* switch(header->message_type) */
1456
1457 }
1458
1459
1460 /* Struct = IDL:omg.org/CosNaming/NameComponent:1.0 */
1461
1462 static void decode_CosNaming_NameComponent_st(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_) {
1463
1464     gboolean stream_is_big_endian;          /* big endianess */
1465
1466     
1467     /* Operation specific Variable declarations Begin */
1468
1469     guint32   u_octet4;
1470     gchar   *seq = NULL;
1471     
1472     /* Operation specific Variable declarations End */
1473
1474     
1475     stream_is_big_endian = is_big_endian(header);  /* get stream endianess */
1476
1477
1478     u_octet4 = get_CDR_string(tvb, &seq, offset, stream_is_big_endian, boundary);
1479     if (tree) {
1480        proto_tree_add_text(tree,tvb,*offset-u_octet4,u_octet4,"NameComponent_id (%u) = %s",
1481           u_octet4, (u_octet4 > 0) ? seq : "");
1482     }
1483
1484     g_free(seq);          /*  free buffer  */
1485     seq = NULL;
1486
1487     u_octet4 = get_CDR_string(tvb, &seq, offset, stream_is_big_endian, boundary);
1488     if (tree) {
1489        proto_tree_add_text(tree,tvb,*offset-u_octet4,u_octet4,"NameComponent_kind (%u) = %s",
1490           u_octet4, (u_octet4 > 0) ? seq : "");
1491     }
1492
1493     g_free(seq);          /*  free buffer  */
1494     seq = NULL;
1495
1496 }
1497
1498
1499 /* Struct = IDL:omg.org/CosNaming/Binding:1.0 */
1500
1501 static void decode_CosNaming_Binding_st(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_) {
1502
1503     gboolean stream_is_big_endian;          /* big endianess */
1504
1505     
1506     /* Operation specific Variable declarations Begin */
1507
1508     guint32   u_octet4_loop_Binding_binding_name;
1509     guint32   i_Binding_binding_name;
1510     guint32   u_octet4;
1511     
1512     /* Operation specific Variable declarations End */
1513
1514     
1515     stream_is_big_endian = is_big_endian(header);  /* get stream endianess */
1516
1517
1518     u_octet4_loop_Binding_binding_name = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
1519     if (tree) {
1520        proto_tree_add_text(tree,tvb,*offset-4, 4 ,"Seq length of Binding_binding_name = %u",u_octet4_loop_Binding_binding_name);
1521     }
1522
1523     for (i_Binding_binding_name=0; i_Binding_binding_name < u_octet4_loop_Binding_binding_name; i_Binding_binding_name++) {
1524
1525         /*  Begin struct "CosNaming_NameComponent"  */
1526
1527         
1528
1529         decode_CosNaming_NameComponent_st(tvb, pinfo, tree, offset, header, operation);
1530
1531
1532         /*  End struct "CosNaming_NameComponent"  */
1533
1534     }
1535
1536     
1537     u_octet4 = get_CDR_enum(tvb,offset,stream_is_big_endian, boundary);
1538     if (tree) {
1539        proto_tree_add_text(tree,tvb,*offset-4,4,"Enum value = %u (%s)",u_octet4,val_to_str(u_octet4,CosNaming_BindingType,"Unknown Enum Value"));
1540     }
1541
1542 }
1543
1544
1545 /*
1546  * Called once we accept the packet as being for us; it sets the
1547  * Protocol and Info columns and creates the top-level protocol
1548  * tree item.
1549  */
1550 static proto_tree *start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int *offset) {
1551
1552     proto_item *ti = NULL;
1553     proto_tree *tree = NULL;            /* init later, inside if(tree) */
1554
1555     col_set_str(pinfo->cinfo, COL_PROTOCOL, "COSNAMING");
1556
1557     /*
1558      * Do not clear COL_INFO, as nothing is being written there by
1559      * this dissector yet. So leave it as is from the GIOP dissector.
1560      * TODO: add something useful to COL_INFO
1561      *  if (check_col(pinfo->cinfo, COL_INFO))
1562      *     col_clear(pinfo->cinfo, COL_INFO);
1563      */
1564
1565     if (ptree) {
1566         ti = proto_tree_add_item(ptree, proto_cosnaming, tvb, *offset, -1, FALSE);
1567         tree = proto_item_add_subtree(ti, ett_cosnaming);
1568     }
1569     return tree;
1570 }
1571
1572 static gboolean dissect_cosnaming(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int *offset, MessageHeader *header, gchar *operation, gchar *idlname) {
1573
1574     gboolean be;                        /* big endianess */
1575     proto_tree *tree _U_;
1576
1577     be = is_big_endian(header);         /* get endianess - TODO use passed in stream_is_big_endian instead ? */
1578
1579     /* If we have a USER Exception, then decode it and return */
1580
1581     if ((header->message_type == Reply) && (header->rep_status == USER_EXCEPTION)) {
1582
1583        return decode_user_exception(tvb, pinfo, ptree, offset, header, operation);
1584
1585     }
1586
1587
1588
1589     switch(header->message_type) {
1590
1591     case Request:
1592     case Reply:
1593
1594
1595         if (strcmp(operation, CosNaming_NamingContext_bind_op) == 0
1596             && (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
1597            tree = start_dissecting(tvb, pinfo, ptree, offset);
1598            decode_CosNaming_NamingContext_bind(tvb, pinfo, tree, offset, header, operation);
1599            return TRUE;
1600         }
1601
1602         if (strcmp(operation, CosNaming_NamingContext_rebind_op) == 0
1603             && (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
1604            tree = start_dissecting(tvb, pinfo, ptree, offset);
1605            decode_CosNaming_NamingContext_rebind(tvb, pinfo, tree, offset, header, operation);
1606            return TRUE;
1607         }
1608
1609         if (strcmp(operation, CosNaming_NamingContext_bind_context_op) == 0
1610             && (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
1611            tree = start_dissecting(tvb, pinfo, ptree, offset);
1612            decode_CosNaming_NamingContext_bind_context(tvb, pinfo, tree, offset, header, operation);
1613            return TRUE;
1614         }
1615
1616         if (strcmp(operation, CosNaming_NamingContext_rebind_context_op) == 0
1617             && (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
1618            tree = start_dissecting(tvb, pinfo, ptree, offset);
1619            decode_CosNaming_NamingContext_rebind_context(tvb, pinfo, tree, offset, header, operation);
1620            return TRUE;
1621         }
1622
1623         if (strcmp(operation, CosNaming_NamingContext_resolve_op) == 0
1624             && (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
1625            tree = start_dissecting(tvb, pinfo, ptree, offset);
1626            decode_CosNaming_NamingContext_resolve(tvb, pinfo, tree, offset, header, operation);
1627            return TRUE;
1628         }
1629
1630         if (strcmp(operation, CosNaming_NamingContext_unbind_op) == 0
1631             && (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
1632            tree = start_dissecting(tvb, pinfo, ptree, offset);
1633            decode_CosNaming_NamingContext_unbind(tvb, pinfo, tree, offset, header, operation);
1634            return TRUE;
1635         }
1636
1637         if (strcmp(operation, CosNaming_NamingContext_new_context_op) == 0
1638             && (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
1639            tree = start_dissecting(tvb, pinfo, ptree, offset);
1640            decode_CosNaming_NamingContext_new_context(tvb, pinfo, tree, offset, header, operation);
1641            return TRUE;
1642         }
1643
1644         if (strcmp(operation, CosNaming_NamingContext_bind_new_context_op) == 0
1645             && (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
1646            tree = start_dissecting(tvb, pinfo, ptree, offset);
1647            decode_CosNaming_NamingContext_bind_new_context(tvb, pinfo, tree, offset, header, operation);
1648            return TRUE;
1649         }
1650
1651         if (strcmp(operation, CosNaming_NamingContext_destroy_op) == 0
1652             && (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
1653            tree = start_dissecting(tvb, pinfo, ptree, offset);
1654            decode_CosNaming_NamingContext_destroy(tvb, pinfo, tree, offset, header, operation);
1655            return TRUE;
1656         }
1657
1658         if (strcmp(operation, CosNaming_NamingContext_list_op) == 0
1659             && (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
1660            tree = start_dissecting(tvb, pinfo, ptree, offset);
1661            decode_CosNaming_NamingContext_list(tvb, pinfo, tree, offset, header, operation);
1662            return TRUE;
1663         }
1664
1665         if (strcmp(operation, CosNaming_BindingIterator_next_one_op) == 0
1666             && (!idlname || strcmp(idlname, "CosNaming/BindingIterator") == 0)) {
1667            tree = start_dissecting(tvb, pinfo, ptree, offset);
1668            decode_CosNaming_BindingIterator_next_one(tvb, pinfo, tree, offset, header, operation);
1669            return TRUE;
1670         }
1671
1672         if (strcmp(operation, CosNaming_BindingIterator_next_n_op) == 0
1673             && (!idlname || strcmp(idlname, "CosNaming/BindingIterator") == 0)) {
1674            tree = start_dissecting(tvb, pinfo, ptree, offset);
1675            decode_CosNaming_BindingIterator_next_n(tvb, pinfo, tree, offset, header, operation);
1676            return TRUE;
1677         }
1678
1679         if (strcmp(operation, CosNaming_BindingIterator_destroy_op) == 0
1680             && (!idlname || strcmp(idlname, "CosNaming/BindingIterator") == 0)) {
1681            tree = start_dissecting(tvb, pinfo, ptree, offset);
1682            decode_CosNaming_BindingIterator_destroy(tvb, pinfo, tree, offset, header, operation);
1683            return TRUE;
1684         }
1685
1686         
1687         break;
1688
1689     case CancelRequest:
1690     case LocateRequest:
1691     case LocateReply:
1692     case CloseConnection:
1693     case MessageError:
1694     case Fragment:
1695        return FALSE;      /* not handled yet */
1696
1697     default:
1698        return FALSE;      /* not handled yet */
1699
1700     }   /* switch */
1701
1702
1703
1704     return FALSE;
1705
1706 }  /* End of main dissector  */
1707
1708
1709
1710
1711 /* Register the protocol with Wireshark */
1712
1713 void proto_register_giop_cosnaming(void) {
1714
1715    /* setup list of header fields */
1716
1717 #if 0
1718    static hf_register_info hf[] = {
1719
1720       /* no fields yet */
1721
1722    };
1723 #endif
1724
1725    /* setup protocol subtree array */
1726
1727    static gint *ett[] = {
1728       &ett_cosnaming,
1729    };
1730
1731    /* Register the protocol name and description */
1732
1733    proto_cosnaming = proto_register_protocol("Cosnaming Dissector Using GIOP API" , "COSNAMING", "giop-cosnaming" );
1734
1735 #if 0
1736    proto_register_field_array(proto_cosnaming, hf, array_length(hf));
1737 #endif
1738    proto_register_subtree_array(ett,array_length(ett));
1739
1740 }
1741
1742
1743
1744
1745 /* register me as handler for these interfaces */
1746
1747 void proto_register_handoff_giop_cosnaming(void) {
1748
1749
1750     
1751
1752     /* Register for Explicit Dissection */
1753
1754     register_giop_user_module(dissect_cosnaming, "COSNAMING", "CosNaming/BindingIterator", proto_cosnaming );     /* explicit dissector */
1755
1756
1757
1758     
1759
1760     /* Register for Explicit Dissection */
1761
1762     register_giop_user_module(dissect_cosnaming, "COSNAMING", "CosNaming/NamingContext", proto_cosnaming );     /* explicit dissector */
1763
1764
1765
1766     
1767
1768     /* Register for Heuristic Dissection */
1769
1770     register_giop_user(dissect_cosnaming, "COSNAMING" ,proto_cosnaming);     /* heuristic dissector */
1771
1772
1773
1774 }
1775
1776
1777
1778 #ifndef ENABLE_STATIC
1779
1780 G_MODULE_EXPORT void
1781 plugin_register(void)
1782 {
1783    if (proto_cosnaming == -1) {
1784      proto_register_giop_cosnaming();
1785    }
1786 }
1787
1788 G_MODULE_EXPORT void
1789 plugin_reg_handoff(void){
1790    proto_register_handoff_giop_cosnaming();
1791 }
1792
1793 #endif
1794
1795