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