ASN.1 dissectors regenerated with new asn2wrs to get updated field blurb
[obnox/wireshark/wip.git] / epan / dissectors / packet-rtse.c
1 /* Do not modify this file.                                                   */
2 /* It is created automatically by the ASN.1 to Wireshark dissector compiler   */
3 /* .\packet-rtse.c                                                            */
4 /* ../../tools/asn2wrs.py -b -e -p rtse -c rtse.cnf -s packet-rtse-template rtse.asn */
5
6 /* Input file: packet-rtse-template.c */
7
8 #line 1 "packet-rtse-template.c"
9 /* packet-rtse_asn1.c
10  * Routines for RTSE packet dissection
11  * Graeme Lunt 2005
12  *
13  * $Id$
14  *
15  * Wireshark - Network traffic analyzer
16  * By Gerald Combs <gerald@wireshark.org>
17  * Copyright 1998 Gerald Combs
18  *
19  * This program is free software; you can redistribute it and/or
20  * modify it under the terms of the GNU General Public License
21  * as published by the Free Software Foundation; either version 2
22  * of the License, or (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program; if not, write to the Free Software
31  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
32  */
33
34 #ifdef HAVE_CONFIG_H
35 # include "config.h"
36 #endif
37
38 #include <glib.h>
39 #include <epan/packet.h>
40 #include <epan/conversation.h>
41
42 #include <stdio.h>
43 #include <string.h>
44
45 #include "packet-ber.h"
46 #include "packet-pres.h"
47 #include "packet-acse.h"
48 #include "packet-ros.h"
49 #include "packet-rtse.h"
50
51 #define PNAME  "X.228 OSI Reliable Transfer Service"
52 #define PSNAME "RTSE"
53 #define PFNAME "rtse"
54
55 /* Initialize the protocol and registered fields */
56 int proto_rtse = -1;
57
58 static struct SESSION_DATA_STRUCTURE* session = NULL;
59
60 static char object_identifier_id[MAX_OID_STR_LEN];
61 static gboolean open_request=FALSE;
62 /* indirect_reference, used to pick up the signalling so we know what
63    kind of data is transferred in SES_DATA_TRANSFER_PDUs */
64 static guint32 indir_ref=0;
65 static guint32 app_proto=0;
66
67 static proto_tree *top_tree=NULL;
68
69 static  dissector_handle_t rtse_handle = NULL;
70 static  dissector_handle_t ros_handle = NULL;
71
72
73 /*--- Included file: packet-rtse-hf.c ---*/
74 #line 1 "packet-rtse-hf.c"
75 static int hf_rtse_rtorq_apdu = -1;               /* RTORQapdu */
76 static int hf_rtse_rtoac_apdu = -1;               /* RTOACapdu */
77 static int hf_rtse_rtorj_apdu = -1;               /* RTORJapdu */
78 static int hf_rtse_rttp_apdu = -1;                /* RTTPapdu */
79 static int hf_rtse_rttr_apdu = -1;                /* RTTRapdu */
80 static int hf_rtse_rtab_apdu = -1;                /* RTABapdu */
81 static int hf_rtse_checkpointSize = -1;           /* INTEGER */
82 static int hf_rtse_windowSize = -1;               /* INTEGER */
83 static int hf_rtse_dialogueMode = -1;             /* T_dialogueMode */
84 static int hf_rtse_connectionDataRQ = -1;         /* ConnectionData */
85 static int hf_rtse_applicationProtocol = -1;      /* T_applicationProtocol */
86 static int hf_rtse_connectionDataAC = -1;         /* ConnectionData */
87 static int hf_rtse_refuseReason = -1;             /* RefuseReason */
88 static int hf_rtse_userDataRJ = -1;               /* T_userDataRJ */
89 static int hf_rtse_abortReason = -1;              /* AbortReason */
90 static int hf_rtse_reflectedParameter = -1;       /* BIT_STRING */
91 static int hf_rtse_userdataAB = -1;               /* T_userdataAB */
92 static int hf_rtse_open = -1;                     /* T_open */
93 static int hf_rtse_recover = -1;                  /* SessionConnectionIdentifier */
94 static int hf_rtse_callingSSuserReference = -1;   /* CallingSSuserReference */
95 static int hf_rtse_commonReference = -1;          /* CommonReference */
96 static int hf_rtse_additionalReferenceInformation = -1;  /* AdditionalReferenceInformation */
97 static int hf_rtse_t61String = -1;                /* T61String */
98 static int hf_rtse_octetString = -1;              /* OCTET_STRING */
99 static int hf_rtse_direct_reference = -1;         /* OBJECT_IDENTIFIER */
100 static int hf_rtse_indirect_reference = -1;       /* T_indirect_reference */
101 static int hf_rtse_data_value_descriptor = -1;    /* ObjectDescriptor */
102 static int hf_rtse_encoding = -1;                 /* T_encoding */
103 static int hf_rtse_single_ASN1_type = -1;         /* T_single_ASN1_type */
104 static int hf_rtse_octet_aligned = -1;            /* OCTET_STRING */
105 static int hf_rtse_arbitrary = -1;                /* BIT_STRING */
106
107 /*--- End of included file: packet-rtse-hf.c ---*/
108 #line 65 "packet-rtse-template.c"
109
110 /* Initialize the subtree pointers */
111 static gint ett_rtse = -1;
112
113 /*--- Included file: packet-rtse-ett.c ---*/
114 #line 1 "packet-rtse-ett.c"
115 static gint ett_rtse_RTSE_apdus = -1;
116 static gint ett_rtse_RTORQapdu = -1;
117 static gint ett_rtse_RTOACapdu = -1;
118 static gint ett_rtse_RTORJapdu = -1;
119 static gint ett_rtse_RTABapdu = -1;
120 static gint ett_rtse_ConnectionData = -1;
121 static gint ett_rtse_SessionConnectionIdentifier = -1;
122 static gint ett_rtse_CallingSSuserReference = -1;
123 static gint ett_rtse_EXTERNAL = -1;
124 static gint ett_rtse_T_encoding = -1;
125
126 /*--- End of included file: packet-rtse-ett.c ---*/
127 #line 69 "packet-rtse-template.c"
128
129
130 static dissector_table_t rtse_oid_dissector_table=NULL;
131 static GHashTable *oid_table=NULL;
132 static gint ett_rtse_unknown = -1;
133
134 void
135 register_rtse_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name, gboolean uses_ros)
136 {
137
138   /* save the name - but not used */
139   g_hash_table_insert(oid_table, (gpointer)oid, (gpointer)name);
140
141   /* register RTSE with the BER (ACSE) */
142   register_ber_oid_dissector_handle(oid, rtse_handle, proto, name);
143
144   if(uses_ros) {
145     /* make sure we call ROS ... */
146     dissector_add_string("rtse.oid", oid, ros_handle);
147
148     /* and then tell ROS how to dissect the AS*/
149     register_ros_oid_dissector_handle(oid, dissector, proto, name, TRUE);
150
151   } else {
152     /* otherwise we just remember how to dissect the AS */
153     dissector_add_string("rtse.oid", oid, dissector);
154   }
155 }
156
157 static int
158 call_rtse_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
159 {
160         tvbuff_t *next_tvb;
161
162         next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), tvb_reported_length_remaining(tvb, offset));
163         if(!dissector_try_string(rtse_oid_dissector_table, oid, next_tvb, pinfo, tree)){
164                 proto_item *item=NULL;
165                 proto_tree *next_tree=NULL;
166
167                 item=proto_tree_add_text(tree, next_tvb, 0, tvb_length_remaining(tvb, offset), "RTSE: Dissector for OID:%s not implemented. Contact Wireshark developers if you want this supported", oid);
168                 if(item){
169                         next_tree=proto_item_add_subtree(item, ett_rtse_unknown);
170                 }
171                 dissect_unknown_ber(pinfo, next_tvb, offset, next_tree);
172         }
173
174         /*XXX until we change the #.REGISTER signature for _PDU()s 
175          * into new_dissector_t   we have to do this kludge with
176          * manually step past the content in the ANY type.
177          */
178         offset+=tvb_length_remaining(tvb, offset);
179
180         return offset;
181 }
182
183
184 /*--- Included file: packet-rtse-fn.c ---*/
185 #line 1 "packet-rtse-fn.c"
186 /*--- Fields for imported types ---*/
187
188
189
190
191 static int
192 dissect_rtse_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
193   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
194                                   NULL);
195
196   return offset;
197 }
198 static int dissect_checkpointSize_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
199   return dissect_rtse_INTEGER(TRUE, tvb, offset, pinfo, tree, hf_rtse_checkpointSize);
200 }
201 static int dissect_windowSize_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
202   return dissect_rtse_INTEGER(TRUE, tvb, offset, pinfo, tree, hf_rtse_windowSize);
203 }
204
205
206 static const value_string rtse_T_dialogueMode_vals[] = {
207   {   0, "monologue" },
208   {   1, "twa" },
209   { 0, NULL }
210 };
211
212
213 static int
214 dissect_rtse_T_dialogueMode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
215   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
216                                   NULL);
217
218   return offset;
219 }
220 static int dissect_dialogueMode_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
221   return dissect_rtse_T_dialogueMode(TRUE, tvb, offset, pinfo, tree, hf_rtse_dialogueMode);
222 }
223
224
225
226 static int
227 dissect_rtse_T_open(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
228 #line 53 "rtse.cnf"
229
230         char *oid = NULL;
231
232         switch(app_proto)  {
233         case 1:         /* mts-transfer-protocol-1984 */
234                 oid = "applicationProtocol.1";
235                 break;
236         case 12:        /* mts-transfer-protocol */
237                 oid = "applicationProtocol.12";
238                 break;
239         default:
240                 if(session && session->pres_ctx_id)
241                         oid = find_oid_by_pres_ctx_id(pinfo, session->pres_ctx_id);
242                 break;
243         }
244         
245         if(!oid) /* XXX: problem here is we haven't decoded the applicationProtocol yet - so we make assumptions! */
246                 oid = "applicationProtocol.12";
247
248         if(oid) {
249
250                 offset = call_rtse_oid_callback(oid, tvb, offset, pinfo, top_tree ? top_tree : tree);
251         }
252
253         /* else XXX: need to flag we can't find the presentation context */
254
255
256
257   return offset;
258 }
259 static int dissect_open(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
260   return dissect_rtse_T_open(FALSE, tvb, offset, pinfo, tree, hf_rtse_open);
261 }
262
263
264
265 static int
266 dissect_rtse_T61String(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
267 #line 143 "rtse.cnf"
268   tvbuff_t *string = NULL;
269     offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_TeletexString,
270                                             pinfo, tree, tvb, offset, hf_index,
271                                             &string);
272
273   if(open_request && string && check_col(pinfo->cinfo, COL_INFO))
274     col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_format_text(string, 0, tvb_length(string)));
275
276
277
278   return offset;
279 }
280 static int dissect_t61String(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
281   return dissect_rtse_T61String(FALSE, tvb, offset, pinfo, tree, hf_rtse_t61String);
282 }
283
284
285
286 static int
287 dissect_rtse_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
288 #line 159 "rtse.cnf"
289   tvbuff_t *string = NULL;
290     offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
291                                        &string);
292
293   if(open_request && string && check_col(pinfo->cinfo, COL_INFO))
294     col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_format_text(string, 0, tvb_length(string)));
295
296
297
298   return offset;
299 }
300 static int dissect_octetString(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
301   return dissect_rtse_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_rtse_octetString);
302 }
303 static int dissect_octet_aligned_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
304   return dissect_rtse_OCTET_STRING(TRUE, tvb, offset, pinfo, tree, hf_rtse_octet_aligned);
305 }
306
307
308 static const value_string rtse_CallingSSuserReference_vals[] = {
309   {   0, "t61String" },
310   {   1, "octetString" },
311   { 0, NULL }
312 };
313
314 static const ber_choice_t CallingSSuserReference_choice[] = {
315   {   0, BER_CLASS_UNI, BER_UNI_TAG_TeletexString, BER_FLAGS_NOOWNTAG, dissect_t61String },
316   {   1, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_octetString },
317   { 0, 0, 0, 0, NULL }
318 };
319
320 static int
321 dissect_rtse_CallingSSuserReference(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
322   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
323                                  CallingSSuserReference_choice, hf_index, ett_rtse_CallingSSuserReference,
324                                  NULL);
325
326   return offset;
327 }
328 static int dissect_callingSSuserReference(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
329   return dissect_rtse_CallingSSuserReference(FALSE, tvb, offset, pinfo, tree, hf_rtse_callingSSuserReference);
330 }
331
332
333
334 static int
335 dissect_rtse_CommonReference(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
336 #line 151 "rtse.cnf"
337   tvbuff_t *string = NULL;
338     offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_UTCTime,
339                                             pinfo, tree, tvb, offset, hf_index,
340                                             &string);
341
342   if(open_request && string && check_col(pinfo->cinfo, COL_INFO))
343     col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_format_text(string, 0, tvb_length(string)));
344
345
346
347   return offset;
348 }
349 static int dissect_commonReference(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
350   return dissect_rtse_CommonReference(FALSE, tvb, offset, pinfo, tree, hf_rtse_commonReference);
351 }
352
353
354
355 static int
356 dissect_rtse_AdditionalReferenceInformation(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
357   offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_TeletexString,
358                                             pinfo, tree, tvb, offset, hf_index,
359                                             NULL);
360
361   return offset;
362 }
363 static int dissect_additionalReferenceInformation_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
364   return dissect_rtse_AdditionalReferenceInformation(TRUE, tvb, offset, pinfo, tree, hf_rtse_additionalReferenceInformation);
365 }
366
367
368 static const ber_sequence_t SessionConnectionIdentifier_sequence[] = {
369   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_callingSSuserReference },
370   { BER_CLASS_UNI, BER_UNI_TAG_UTCTime, BER_FLAGS_NOOWNTAG, dissect_commonReference },
371   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_additionalReferenceInformation_impl },
372   { 0, 0, 0, NULL }
373 };
374
375 static int
376 dissect_rtse_SessionConnectionIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
377 #line 136 "rtse.cnf"
378   if(open_request && check_col(pinfo->cinfo, COL_INFO))
379     col_append_fstr(pinfo->cinfo, COL_INFO, "Recover");
380     offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
381                                    SessionConnectionIdentifier_sequence, hf_index, ett_rtse_SessionConnectionIdentifier);
382
383
384
385
386   return offset;
387 }
388 static int dissect_recover_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
389   return dissect_rtse_SessionConnectionIdentifier(TRUE, tvb, offset, pinfo, tree, hf_rtse_recover);
390 }
391
392
393 static const value_string rtse_ConnectionData_vals[] = {
394   {   0, "open" },
395   {   1, "recover" },
396   { 0, NULL }
397 };
398
399 static const ber_choice_t ConnectionData_choice[] = {
400   {   0, BER_CLASS_CON, 0, 0, dissect_open },
401   {   1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_recover_impl },
402   { 0, 0, 0, 0, NULL }
403 };
404
405 static int
406 dissect_rtse_ConnectionData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
407   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
408                                  ConnectionData_choice, hf_index, ett_rtse_ConnectionData,
409                                  NULL);
410
411   return offset;
412 }
413 static int dissect_connectionDataRQ(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
414   return dissect_rtse_ConnectionData(FALSE, tvb, offset, pinfo, tree, hf_rtse_connectionDataRQ);
415 }
416 static int dissect_connectionDataAC(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
417   return dissect_rtse_ConnectionData(FALSE, tvb, offset, pinfo, tree, hf_rtse_connectionDataAC);
418 }
419
420
421 static const value_string rtse_T_applicationProtocol_vals[] = {
422   {  12, "mts-transfer-protocol" },
423   {   1, "mts-transfer-protocol-1984" },
424   { 0, NULL }
425 };
426
427
428 static int
429 dissect_rtse_T_applicationProtocol(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
430 #line 132 "rtse.cnf"
431
432   offset = dissect_ber_integer(TRUE, pinfo, tree, tvb, offset, hf_index, &app_proto);
433
434
435
436   return offset;
437 }
438 static int dissect_applicationProtocol_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
439   return dissect_rtse_T_applicationProtocol(TRUE, tvb, offset, pinfo, tree, hf_rtse_applicationProtocol);
440 }
441
442
443 static const ber_sequence_t RTORQapdu_set[] = {
444   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_checkpointSize_impl },
445   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_windowSize_impl },
446   { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_dialogueMode_impl },
447   { BER_CLASS_CON, 3, BER_FLAGS_NOTCHKTAG, dissect_connectionDataRQ },
448   { BER_CLASS_CON, 4, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_applicationProtocol_impl },
449   { 0, 0, 0, NULL }
450 };
451
452 int
453 dissect_rtse_RTORQapdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
454 #line 38 "rtse.cnf"
455
456   if((session = (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data)) != NULL)
457         session->ros_op = (ROS_OP_BIND | ROS_OP_ARGUMENT);
458   open_request=TRUE;
459     offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset,
460                               RTORQapdu_set, hf_index, ett_rtse_RTORQapdu);
461
462   open_request=FALSE;
463
464
465
466   return offset;
467 }
468 static int dissect_rtorq_apdu_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
469   return dissect_rtse_RTORQapdu(TRUE, tvb, offset, pinfo, tree, hf_rtse_rtorq_apdu);
470 }
471
472
473 static const ber_sequence_t RTOACapdu_set[] = {
474   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_checkpointSize_impl },
475   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_windowSize_impl },
476   { BER_CLASS_CON, 2, BER_FLAGS_NOTCHKTAG, dissect_connectionDataAC },
477   { 0, 0, 0, NULL }
478 };
479
480 int
481 dissect_rtse_RTOACapdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
482 #line 46 "rtse.cnf"
483
484   if((session = (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data)) != NULL)
485         session->ros_op = (ROS_OP_BIND | ROS_OP_RESULT);
486
487     offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset,
488                               RTOACapdu_set, hf_index, ett_rtse_RTOACapdu);
489
490
491
492
493   return offset;
494 }
495 static int dissect_rtoac_apdu_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
496   return dissect_rtse_RTOACapdu(TRUE, tvb, offset, pinfo, tree, hf_rtse_rtoac_apdu);
497 }
498
499
500 static const value_string rtse_RefuseReason_vals[] = {
501   {   0, "rtsBusy" },
502   {   1, "cannotRecover" },
503   {   2, "validationFailure" },
504   {   3, "unacceptableDialogueMode" },
505   { 0, NULL }
506 };
507
508
509 static int
510 dissect_rtse_RefuseReason(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
511   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
512                                   NULL);
513
514   return offset;
515 }
516 static int dissect_refuseReason_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
517   return dissect_rtse_RefuseReason(TRUE, tvb, offset, pinfo, tree, hf_rtse_refuseReason);
518 }
519
520
521
522 static int
523 dissect_rtse_T_userDataRJ(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
524 #line 9 "rtse.cnf"
525         char *oid = NULL;
526
527         switch(app_proto)  {
528         case 1:         /* mts-transfer-protocol-1984 */
529                 oid = "applicationProtocol.1";
530                 break;
531         case 12:        /* mts-transfer-protocol */
532                 oid = "applicationProtocol.12";
533                 break;
534         default:
535                 if(session && session->pres_ctx_id)
536                         oid = find_oid_by_pres_ctx_id(pinfo, session->pres_ctx_id);
537                 break;
538         }
539         
540         if(!oid) /* XXX: problem here is we haven't decoded the applicationProtocol yet - so we make assumptions! */
541                 oid = "applicationProtocol.12";
542
543         if(oid) {
544           if((session = (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data)) != NULL)
545                 session->ros_op = (ROS_OP_BIND | ROS_OP_ERROR);
546
547                 offset = call_rtse_oid_callback(oid, tvb, offset, pinfo, top_tree ? top_tree : tree);
548         }
549
550
551
552   return offset;
553 }
554 static int dissect_userDataRJ(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
555   return dissect_rtse_T_userDataRJ(FALSE, tvb, offset, pinfo, tree, hf_rtse_userDataRJ);
556 }
557
558
559 static const ber_sequence_t RTORJapdu_set[] = {
560   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_refuseReason_impl },
561   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_userDataRJ },
562   { 0, 0, 0, NULL }
563 };
564
565 int
566 dissect_rtse_RTORJapdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
567   offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset,
568                               RTORJapdu_set, hf_index, ett_rtse_RTORJapdu);
569
570   return offset;
571 }
572 static int dissect_rtorj_apdu_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
573   return dissect_rtse_RTORJapdu(TRUE, tvb, offset, pinfo, tree, hf_rtse_rtorj_apdu);
574 }
575
576
577
578 static int
579 dissect_rtse_RTTPapdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
580   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
581                                   NULL);
582
583   return offset;
584 }
585 static int dissect_rttp_apdu(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
586   return dissect_rtse_RTTPapdu(FALSE, tvb, offset, pinfo, tree, hf_rtse_rttp_apdu);
587 }
588
589
590
591 static int
592 dissect_rtse_RTTRapdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
593 #line 80 "rtse.cnf"
594         tvbuff_t *next_tvb = NULL;
595
596         offset = dissect_ber_octet_string(FALSE, pinfo, tree, tvb, offset, hf_index, &next_tvb);
597
598         if(next_tvb) {
599
600                 /* XXX: we should check is this is an EXTERNAL first */
601
602                 /* ROS won't do this for us */
603                 if(session)
604                         session->ros_op = (ROS_OP_INVOKE | ROS_OP_ARGUMENT);
605
606                 offset = dissect_rtse_EXTERNAL(FALSE, next_tvb, 0, pinfo, tree, -1);
607
608         }
609
610
611
612   return offset;
613 }
614 static int dissect_rttr_apdu(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
615   return dissect_rtse_RTTRapdu(FALSE, tvb, offset, pinfo, tree, hf_rtse_rttr_apdu);
616 }
617
618
619 static const value_string rtse_AbortReason_vals[] = {
620   {   0, "localSystemProblem" },
621   {   1, "invalidParameter" },
622   {   2, "unrecognizedActivity" },
623   {   3, "temporaryProblem" },
624   {   4, "protocolError" },
625   {   5, "permanentProblem" },
626   {   6, "userError" },
627   {   7, "transferCompleted" },
628   { 0, NULL }
629 };
630
631
632 static int
633 dissect_rtse_AbortReason(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
634   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
635                                   NULL);
636
637   return offset;
638 }
639 static int dissect_abortReason_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
640   return dissect_rtse_AbortReason(TRUE, tvb, offset, pinfo, tree, hf_rtse_abortReason);
641 }
642
643
644
645 static int
646 dissect_rtse_BIT_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
647   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
648                                     NULL, hf_index, -1,
649                                     NULL);
650
651   return offset;
652 }
653 static int dissect_reflectedParameter_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
654   return dissect_rtse_BIT_STRING(TRUE, tvb, offset, pinfo, tree, hf_rtse_reflectedParameter);
655 }
656 static int dissect_arbitrary_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
657   return dissect_rtse_BIT_STRING(TRUE, tvb, offset, pinfo, tree, hf_rtse_arbitrary);
658 }
659
660
661
662 static int
663 dissect_rtse_T_userdataAB(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
664 #line 35 "rtse.cnf"
665 /*XXX not implemented yet */
666
667
668
669   return offset;
670 }
671 static int dissect_userdataAB(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
672   return dissect_rtse_T_userdataAB(FALSE, tvb, offset, pinfo, tree, hf_rtse_userdataAB);
673 }
674
675
676 static const ber_sequence_t RTABapdu_set[] = {
677   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_abortReason_impl },
678   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_reflectedParameter_impl },
679   { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_userdataAB },
680   { 0, 0, 0, NULL }
681 };
682
683 int
684 dissect_rtse_RTABapdu(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
685   offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset,
686                               RTABapdu_set, hf_index, ett_rtse_RTABapdu);
687
688   return offset;
689 }
690 static int dissect_rtab_apdu_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
691   return dissect_rtse_RTABapdu(TRUE, tvb, offset, pinfo, tree, hf_rtse_rtab_apdu);
692 }
693
694
695 static const value_string rtse_RTSE_apdus_vals[] = {
696   {   0, "rtorq-apdu" },
697   {   1, "rtoac-apdu" },
698   {   2, "rtorj-apdu" },
699   {   3, "rttp-apdu" },
700   {   4, "rttr-apdu" },
701   {   5, "rtab-apdu" },
702   { 0, NULL }
703 };
704
705 static const ber_choice_t RTSE_apdus_choice[] = {
706   {   0, BER_CLASS_CON, 16, BER_FLAGS_IMPLTAG, dissect_rtorq_apdu_impl },
707   {   1, BER_CLASS_CON, 17, BER_FLAGS_IMPLTAG, dissect_rtoac_apdu_impl },
708   {   2, BER_CLASS_CON, 18, BER_FLAGS_IMPLTAG, dissect_rtorj_apdu_impl },
709   {   3, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_rttp_apdu },
710   {   4, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_rttr_apdu },
711   {   5, BER_CLASS_CON, 22, BER_FLAGS_IMPLTAG, dissect_rtab_apdu_impl },
712   { 0, 0, 0, 0, NULL }
713 };
714
715 static int
716 dissect_rtse_RTSE_apdus(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
717   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
718                                  RTSE_apdus_choice, hf_index, ett_rtse_RTSE_apdus,
719                                  NULL);
720
721   return offset;
722 }
723
724
725
726 static int
727 dissect_rtse_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
728   offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
729
730   return offset;
731 }
732 static int dissect_direct_reference(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
733   return dissect_rtse_OBJECT_IDENTIFIER(FALSE, tvb, offset, pinfo, tree, hf_rtse_direct_reference);
734 }
735
736
737
738 static int
739 dissect_rtse_T_indirect_reference(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
740 #line 115 "rtse.cnf"
741   char *oid;
742
743   offset = dissect_ber_integer(FALSE, pinfo, tree, tvb, offset,
744                 hf_rtse_indirect_reference,
745                 &indir_ref);
746
747   /* look up the indirect reference */
748   if((oid = find_oid_by_pres_ctx_id(pinfo, indir_ref)) != NULL) {
749     g_snprintf(object_identifier_id, MAX_OID_STR_LEN, "%s", oid);
750   }
751         
752
753
754
755   return offset;
756 }
757 static int dissect_indirect_reference(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
758   return dissect_rtse_T_indirect_reference(FALSE, tvb, offset, pinfo, tree, hf_rtse_indirect_reference);
759 }
760
761
762
763 static int
764 dissect_rtse_ObjectDescriptor(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
765   offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_ObjectDescriptor,
766                                             pinfo, tree, tvb, offset, hf_index,
767                                             NULL);
768
769   return offset;
770 }
771 static int dissect_data_value_descriptor(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
772   return dissect_rtse_ObjectDescriptor(FALSE, tvb, offset, pinfo, tree, hf_rtse_data_value_descriptor);
773 }
774
775
776
777 static int
778 dissect_rtse_T_single_ASN1_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
779 #line 128 "rtse.cnf"
780   offset=call_rtse_oid_callback(object_identifier_id, tvb, offset, pinfo, top_tree);
781
782
783
784
785   return offset;
786 }
787 static int dissect_single_ASN1_type(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
788   return dissect_rtse_T_single_ASN1_type(FALSE, tvb, offset, pinfo, tree, hf_rtse_single_ASN1_type);
789 }
790
791
792 static const value_string rtse_T_encoding_vals[] = {
793   {   0, "single-ASN1-type" },
794   {   1, "octet-aligned" },
795   {   2, "arbitrary" },
796   { 0, NULL }
797 };
798
799 static const ber_choice_t T_encoding_choice[] = {
800   {   0, BER_CLASS_CON, 0, 0, dissect_single_ASN1_type },
801   {   1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_octet_aligned_impl },
802   {   2, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_arbitrary_impl },
803   { 0, 0, 0, 0, NULL }
804 };
805
806 static int
807 dissect_rtse_T_encoding(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
808   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
809                                  T_encoding_choice, hf_index, ett_rtse_T_encoding,
810                                  NULL);
811
812   return offset;
813 }
814 static int dissect_encoding(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
815   return dissect_rtse_T_encoding(FALSE, tvb, offset, pinfo, tree, hf_rtse_encoding);
816 }
817
818
819 static const ber_sequence_t EXTERNAL_sequence[] = {
820   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_direct_reference },
821   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_indirect_reference },
822   { BER_CLASS_UNI, BER_UNI_TAG_ObjectDescriptor, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_data_value_descriptor },
823   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_encoding },
824   { 0, 0, 0, NULL }
825 };
826
827 int
828 dissect_rtse_EXTERNAL(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
829 #line 97 "rtse.cnf"
830   gint8 class;
831   gboolean pc, ind_field;
832   gint32 tag;
833   guint32 len1;
834
835   if(!implicit_tag) {
836     /* XXX  asn2wrs can not yet handle tagged assignment so for the
837      * time being  just remove this tag manually inside the EXTERNAL
838      * dissector.
839      */
840      offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
841      offset = get_ber_length(tree, tvb, offset, &len1, &ind_field);
842    }
843
844    offset = dissect_ber_sequence(TRUE, pinfo, tree, tvb, offset,
845                                 EXTERNAL_sequence, hf_index, ett_rtse_EXTERNAL);
846
847
848
849   return offset;
850 }
851
852
853 /*--- End of included file: packet-rtse-fn.c ---*/
854 #line 125 "packet-rtse-template.c"
855
856 /*
857 * Dissect RTSE PDUs inside a PPDU.
858 */
859 static void
860 dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
861 {
862         int offset = 0;
863         int old_offset;
864         proto_item *item=NULL;
865         proto_tree *tree=NULL;
866
867         /* save parent_tree so subdissectors can create new top nodes */
868         top_tree=parent_tree;
869
870         /* do we have application context from the acse dissector?  */
871         if( !pinfo->private_data ){
872                 if(parent_tree){
873                         proto_tree_add_text(parent_tree, tvb, offset, -1,
874                                 "Internal error:can't get application context from ACSE dissector.");
875                 } 
876                 return  ;
877         } else {
878                 session  = ( (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data) );
879
880         }
881
882         if(parent_tree){
883                 item = proto_tree_add_item(parent_tree, proto_rtse, tvb, 0, -1, FALSE);
884                 tree = proto_item_add_subtree(item, ett_rtse);
885         }
886         if (check_col(pinfo->cinfo, COL_PROTOCOL))
887                 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTSE");
888         if (check_col(pinfo->cinfo, COL_INFO))
889                 col_clear(pinfo->cinfo, COL_INFO);
890
891         while (tvb_reported_length_remaining(tvb, offset) > 0){
892                 old_offset=offset;
893                 offset=dissect_rtse_RTSE_apdus(FALSE, tvb, offset, pinfo , tree, -1);
894                 if(offset == old_offset){
895                         proto_tree_add_text(tree, tvb, offset, -1,"Internal error, zero-byte RTSE PDU");
896                         offset = tvb_length(tvb);
897                         break;
898                 }
899         }
900
901         top_tree = NULL;
902 }
903
904
905 /*--- proto_register_rtse -------------------------------------------*/
906 void proto_register_rtse(void) {
907
908   /* List of fields */
909   static hf_register_info hf[] =
910   {
911
912 /*--- Included file: packet-rtse-hfarr.c ---*/
913 #line 1 "packet-rtse-hfarr.c"
914     { &hf_rtse_rtorq_apdu,
915       { "rtorq-apdu", "rtse.rtorq_apdu",
916         FT_NONE, BASE_NONE, NULL, 0,
917         "rtse.RTORQapdu", HFILL }},
918     { &hf_rtse_rtoac_apdu,
919       { "rtoac-apdu", "rtse.rtoac_apdu",
920         FT_NONE, BASE_NONE, NULL, 0,
921         "rtse.RTOACapdu", HFILL }},
922     { &hf_rtse_rtorj_apdu,
923       { "rtorj-apdu", "rtse.rtorj_apdu",
924         FT_NONE, BASE_NONE, NULL, 0,
925         "rtse.RTORJapdu", HFILL }},
926     { &hf_rtse_rttp_apdu,
927       { "rttp-apdu", "rtse.rttp_apdu",
928         FT_INT32, BASE_DEC, NULL, 0,
929         "rtse.RTTPapdu", HFILL }},
930     { &hf_rtse_rttr_apdu,
931       { "rttr-apdu", "rtse.rttr_apdu",
932         FT_BYTES, BASE_HEX, NULL, 0,
933         "rtse.RTTRapdu", HFILL }},
934     { &hf_rtse_rtab_apdu,
935       { "rtab-apdu", "rtse.rtab_apdu",
936         FT_NONE, BASE_NONE, NULL, 0,
937         "rtse.RTABapdu", HFILL }},
938     { &hf_rtse_checkpointSize,
939       { "checkpointSize", "rtse.checkpointSize",
940         FT_INT32, BASE_DEC, NULL, 0,
941         "rtse.INTEGER", HFILL }},
942     { &hf_rtse_windowSize,
943       { "windowSize", "rtse.windowSize",
944         FT_INT32, BASE_DEC, NULL, 0,
945         "rtse.INTEGER", HFILL }},
946     { &hf_rtse_dialogueMode,
947       { "dialogueMode", "rtse.dialogueMode",
948         FT_INT32, BASE_DEC, VALS(rtse_T_dialogueMode_vals), 0,
949         "rtse.T_dialogueMode", HFILL }},
950     { &hf_rtse_connectionDataRQ,
951       { "connectionDataRQ", "rtse.connectionDataRQ",
952         FT_UINT32, BASE_DEC, VALS(rtse_ConnectionData_vals), 0,
953         "rtse.ConnectionData", HFILL }},
954     { &hf_rtse_applicationProtocol,
955       { "applicationProtocol", "rtse.applicationProtocol",
956         FT_INT32, BASE_DEC, VALS(rtse_T_applicationProtocol_vals), 0,
957         "rtse.T_applicationProtocol", HFILL }},
958     { &hf_rtse_connectionDataAC,
959       { "connectionDataAC", "rtse.connectionDataAC",
960         FT_UINT32, BASE_DEC, VALS(rtse_ConnectionData_vals), 0,
961         "rtse.ConnectionData", HFILL }},
962     { &hf_rtse_refuseReason,
963       { "refuseReason", "rtse.refuseReason",
964         FT_INT32, BASE_DEC, VALS(rtse_RefuseReason_vals), 0,
965         "rtse.RefuseReason", HFILL }},
966     { &hf_rtse_userDataRJ,
967       { "userDataRJ", "rtse.userDataRJ",
968         FT_NONE, BASE_NONE, NULL, 0,
969         "rtse.T_userDataRJ", HFILL }},
970     { &hf_rtse_abortReason,
971       { "abortReason", "rtse.abortReason",
972         FT_INT32, BASE_DEC, VALS(rtse_AbortReason_vals), 0,
973         "rtse.AbortReason", HFILL }},
974     { &hf_rtse_reflectedParameter,
975       { "reflectedParameter", "rtse.reflectedParameter",
976         FT_BYTES, BASE_HEX, NULL, 0,
977         "rtse.BIT_STRING", HFILL }},
978     { &hf_rtse_userdataAB,
979       { "userdataAB", "rtse.userdataAB",
980         FT_NONE, BASE_NONE, NULL, 0,
981         "rtse.T_userdataAB", HFILL }},
982     { &hf_rtse_open,
983       { "open", "rtse.open",
984         FT_NONE, BASE_NONE, NULL, 0,
985         "rtse.T_open", HFILL }},
986     { &hf_rtse_recover,
987       { "recover", "rtse.recover",
988         FT_NONE, BASE_NONE, NULL, 0,
989         "rtse.SessionConnectionIdentifier", HFILL }},
990     { &hf_rtse_callingSSuserReference,
991       { "callingSSuserReference", "rtse.callingSSuserReference",
992         FT_UINT32, BASE_DEC, VALS(rtse_CallingSSuserReference_vals), 0,
993         "rtse.CallingSSuserReference", HFILL }},
994     { &hf_rtse_commonReference,
995       { "commonReference", "rtse.commonReference",
996         FT_STRING, BASE_NONE, NULL, 0,
997         "rtse.CommonReference", HFILL }},
998     { &hf_rtse_additionalReferenceInformation,
999       { "additionalReferenceInformation", "rtse.additionalReferenceInformation",
1000         FT_STRING, BASE_NONE, NULL, 0,
1001         "rtse.AdditionalReferenceInformation", HFILL }},
1002     { &hf_rtse_t61String,
1003       { "t61String", "rtse.t61String",
1004         FT_STRING, BASE_NONE, NULL, 0,
1005         "rtse.T61String", HFILL }},
1006     { &hf_rtse_octetString,
1007       { "octetString", "rtse.octetString",
1008         FT_BYTES, BASE_HEX, NULL, 0,
1009         "rtse.OCTET_STRING", HFILL }},
1010     { &hf_rtse_direct_reference,
1011       { "direct-reference", "rtse.direct_reference",
1012         FT_OID, BASE_NONE, NULL, 0,
1013         "rtse.OBJECT_IDENTIFIER", HFILL }},
1014     { &hf_rtse_indirect_reference,
1015       { "indirect-reference", "rtse.indirect_reference",
1016         FT_INT32, BASE_DEC, NULL, 0,
1017         "rtse.T_indirect_reference", HFILL }},
1018     { &hf_rtse_data_value_descriptor,
1019       { "data-value-descriptor", "rtse.data_value_descriptor",
1020         FT_STRING, BASE_NONE, NULL, 0,
1021         "rtse.ObjectDescriptor", HFILL }},
1022     { &hf_rtse_encoding,
1023       { "encoding", "rtse.encoding",
1024         FT_UINT32, BASE_DEC, VALS(rtse_T_encoding_vals), 0,
1025         "rtse.T_encoding", HFILL }},
1026     { &hf_rtse_single_ASN1_type,
1027       { "single-ASN1-type", "rtse.single_ASN1_type",
1028         FT_NONE, BASE_NONE, NULL, 0,
1029         "rtse.T_single_ASN1_type", HFILL }},
1030     { &hf_rtse_octet_aligned,
1031       { "octet-aligned", "rtse.octet_aligned",
1032         FT_BYTES, BASE_HEX, NULL, 0,
1033         "rtse.OCTET_STRING", HFILL }},
1034     { &hf_rtse_arbitrary,
1035       { "arbitrary", "rtse.arbitrary",
1036         FT_BYTES, BASE_HEX, NULL, 0,
1037         "rtse.BIT_STRING", HFILL }},
1038
1039 /*--- End of included file: packet-rtse-hfarr.c ---*/
1040 #line 182 "packet-rtse-template.c"
1041   };
1042
1043   /* List of subtrees */
1044   static gint *ett[] = {
1045     &ett_rtse,
1046     &ett_rtse_unknown,
1047
1048 /*--- Included file: packet-rtse-ettarr.c ---*/
1049 #line 1 "packet-rtse-ettarr.c"
1050     &ett_rtse_RTSE_apdus,
1051     &ett_rtse_RTORQapdu,
1052     &ett_rtse_RTOACapdu,
1053     &ett_rtse_RTORJapdu,
1054     &ett_rtse_RTABapdu,
1055     &ett_rtse_ConnectionData,
1056     &ett_rtse_SessionConnectionIdentifier,
1057     &ett_rtse_CallingSSuserReference,
1058     &ett_rtse_EXTERNAL,
1059     &ett_rtse_T_encoding,
1060
1061 /*--- End of included file: packet-rtse-ettarr.c ---*/
1062 #line 189 "packet-rtse-template.c"
1063   };
1064
1065   /* Register protocol */
1066   proto_rtse = proto_register_protocol(PNAME, PSNAME, PFNAME);
1067   register_dissector("rtse", dissect_rtse, proto_rtse);
1068   /* Register fields and subtrees */
1069   proto_register_field_array(proto_rtse, hf, array_length(hf));
1070   proto_register_subtree_array(ett, array_length(ett));
1071
1072   rtse_oid_dissector_table = register_dissector_table("rtse.oid", "RTSE OID Dissectors", FT_STRING, BASE_NONE);
1073   oid_table=g_hash_table_new(g_str_hash, g_str_equal);
1074
1075   rtse_handle = find_dissector("rtse");
1076   ros_handle = find_dissector("ros");
1077
1078 }
1079
1080
1081 /*--- proto_reg_handoff_rtse --- */
1082 void proto_reg_handoff_rtse(void) {
1083
1084
1085 }