1 /* Do not modify this file. */
2 /* It is created automatically by the ASN.1 to Wireshark dissector compiler */
4 /* ../../tools/asn2wrs.py -b -e -p smrse -c smrse.cnf -s packet-smrse-template SMRSE.asn */
6 /* Input file: packet-smrse-template.c */
8 #line 1 "packet-smrse-template.c"
10 * Routines for SMRSE Short Message Relay Service packet dissection
11 * Ronnie Sahlberg 2004
15 * Wireshark - Network traffic analyzer
16 * By Gerald Combs <gerald@wireshark.org>
17 * Copyright 1998 Gerald Combs
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version 2
22 * of the License, or (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
39 #include <epan/packet.h>
40 #include <epan/conversation.h>
45 #include "packet-ber.h"
46 #include "packet-smrse.h"
48 #define PNAME "Short Message Relaying Service"
49 #define PSNAME "SMRSE"
50 #define PFNAME "smrse"
52 #define TCP_PORT_SMRSE 4321
54 /* Initialize the protocol and registered fields */
56 static int hf_smrse_reserved = -1;
57 static int hf_smrse_tag = -1;
58 static int hf_smrse_length = -1;
59 static int hf_smrse_Octet_Format = -1;
61 /*--- Included file: packet-smrse-hf.c ---*/
62 #line 1 "packet-smrse-hf.c"
63 static int hf_smrse_sc_address = -1; /* SMS_Address */
64 static int hf_smrse_password = -1; /* Password */
65 static int hf_smrse_address_type = -1; /* T_address_type */
66 static int hf_smrse_numbering_plan = -1; /* T_numbering_plan */
67 static int hf_smrse_address_value = -1; /* T_address_value */
68 static int hf_smrse_octet_format = -1; /* T_octet_format */
69 static int hf_smrse_connect_fail_reason = -1; /* Connect_fail */
70 static int hf_smrse_mt_priority_request = -1; /* BOOLEAN */
71 static int hf_smrse_mt_mms = -1; /* BOOLEAN */
72 static int hf_smrse_mt_message_reference = -1; /* RP_MR */
73 static int hf_smrse_mt_originating_address = -1; /* SMS_Address */
74 static int hf_smrse_mt_destination_address = -1; /* SMS_Address */
75 static int hf_smrse_mt_user_data = -1; /* RP_UD */
76 static int hf_smrse_mt_origVMSCAddr = -1; /* SMS_Address */
77 static int hf_smrse_mt_tariffClass = -1; /* SM_TC */
78 static int hf_smrse_mo_message_reference = -1; /* RP_MR */
79 static int hf_smrse_mo_originating_address = -1; /* SMS_Address */
80 static int hf_smrse_mo_user_data = -1; /* RP_UD */
81 static int hf_smrse_origVMSCAddr = -1; /* SMS_Address */
82 static int hf_smrse_moimsi = -1; /* IMSI_Address */
83 static int hf_smrse_message_reference = -1; /* RP_MR */
84 static int hf_smrse_error_reason = -1; /* Error_reason */
85 static int hf_smrse_msg_waiting_set = -1; /* BOOLEAN */
86 static int hf_smrse_alerting_MS_ISDN = -1; /* SMS_Address */
87 static int hf_smrse_sm_diag_info = -1; /* RP_UD */
88 static int hf_smrse_ms_address = -1; /* SMS_Address */
90 /*--- End of included file: packet-smrse-hf.c ---*/
91 #line 53 "packet-smrse-template.c"
93 /* Initialize the subtree pointers */
94 static gint ett_smrse = -1;
96 /*--- Included file: packet-smrse-ett.c ---*/
97 #line 1 "packet-smrse-ett.c"
98 static gint ett_smrse_SMR_Bind = -1;
99 static gint ett_smrse_SMS_Address = -1;
100 static gint ett_smrse_T_address_value = -1;
101 static gint ett_smrse_SMR_Bind_Confirm = -1;
102 static gint ett_smrse_SMR_Bind_Failure = -1;
103 static gint ett_smrse_SMR_Unbind = -1;
104 static gint ett_smrse_RPDataMT = -1;
105 static gint ett_smrse_RPDataMO = -1;
106 static gint ett_smrse_RPAck = -1;
107 static gint ett_smrse_RPError = -1;
108 static gint ett_smrse_RPAlertSC = -1;
110 /*--- End of included file: packet-smrse-ett.c ---*/
111 #line 57 "packet-smrse-template.c"
115 /*--- Included file: packet-smrse-fn.c ---*/
116 #line 1 "packet-smrse-fn.c"
117 /*--- Fields for imported types ---*/
121 static const value_string smrse_T_address_type_vals[] = {
122 { 0, "unknown-type" },
123 { 1, "internat-number" },
124 { 2, "national-number" },
125 { 3, "net-spec-number" },
126 { 4, "short-number" },
132 dissect_smrse_T_address_type(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
133 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
138 static int dissect_address_type(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
139 return dissect_smrse_T_address_type(FALSE, tvb, offset, pinfo, tree, hf_smrse_address_type);
143 static const value_string smrse_T_numbering_plan_vals[] = {
144 { 0, "unknown-numbering" },
145 { 1, "iSDN-numbering" },
146 { 3, "data-network-numbering" },
147 { 4, "telex-numbering" },
148 { 8, "national-numbering" },
149 { 9, "private-numbering" },
155 dissect_smrse_T_numbering_plan(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
156 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
161 static int dissect_numbering_plan(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
162 return dissect_smrse_T_numbering_plan(FALSE, tvb, offset, pinfo, tree, hf_smrse_numbering_plan);
168 dissect_smrse_SemiOctetString(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
169 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
178 dissect_smrse_T_octet_format(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
180 char *strp,tmpstr[21];
181 guint32 i, start_offset;
186 static char n2a[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
190 /* skip the tag and length */
191 offset=dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag);
192 offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, &ind);
198 *strp++=n2a[tvb_get_guint8(tvb, offset)&0x0f];
199 *strp++=n2a[(tvb_get_guint8(tvb, offset)>>4)&0x0f];
204 proto_tree_add_string(tree, hf_smrse_Octet_Format, tvb, start_offset, offset-start_offset, tmpstr);
212 static int dissect_octet_format(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
213 return dissect_smrse_T_octet_format(FALSE, tvb, offset, pinfo, tree, hf_smrse_octet_format);
217 static const value_string smrse_T_address_value_vals[] = {
218 { 0, "octet-format" },
222 static const ber_choice_t T_address_value_choice[] = {
223 { 0, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_octet_format },
228 dissect_smrse_T_address_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
229 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
230 T_address_value_choice, hf_index, ett_smrse_T_address_value,
235 static int dissect_address_value(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
236 return dissect_smrse_T_address_value(FALSE, tvb, offset, pinfo, tree, hf_smrse_address_value);
240 static const ber_sequence_t SMS_Address_sequence[] = {
241 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_address_type },
242 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_numbering_plan },
243 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_address_value },
248 dissect_smrse_SMS_Address(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
249 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
250 SMS_Address_sequence, hf_index, ett_smrse_SMS_Address);
254 static int dissect_sc_address(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
255 return dissect_smrse_SMS_Address(FALSE, tvb, offset, pinfo, tree, hf_smrse_sc_address);
257 static int dissect_mt_originating_address(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
258 return dissect_smrse_SMS_Address(FALSE, tvb, offset, pinfo, tree, hf_smrse_mt_originating_address);
260 static int dissect_mt_destination_address(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
261 return dissect_smrse_SMS_Address(FALSE, tvb, offset, pinfo, tree, hf_smrse_mt_destination_address);
263 static int dissect_mt_origVMSCAddr_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
264 return dissect_smrse_SMS_Address(TRUE, tvb, offset, pinfo, tree, hf_smrse_mt_origVMSCAddr);
266 static int dissect_mo_originating_address(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
267 return dissect_smrse_SMS_Address(FALSE, tvb, offset, pinfo, tree, hf_smrse_mo_originating_address);
269 static int dissect_origVMSCAddr_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
270 return dissect_smrse_SMS_Address(TRUE, tvb, offset, pinfo, tree, hf_smrse_origVMSCAddr);
272 static int dissect_alerting_MS_ISDN_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
273 return dissect_smrse_SMS_Address(TRUE, tvb, offset, pinfo, tree, hf_smrse_alerting_MS_ISDN);
275 static int dissect_ms_address(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
276 return dissect_smrse_SMS_Address(FALSE, tvb, offset, pinfo, tree, hf_smrse_ms_address);
282 dissect_smrse_Password(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
283 offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString,
284 pinfo, tree, tvb, offset, hf_index,
289 static int dissect_password(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
290 return dissect_smrse_Password(FALSE, tvb, offset, pinfo, tree, hf_smrse_password);
294 static const ber_sequence_t SMR_Bind_sequence[] = {
295 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_sc_address },
296 { BER_CLASS_UNI, BER_UNI_TAG_PrintableString, BER_FLAGS_NOOWNTAG, dissect_password },
301 dissect_smrse_SMR_Bind(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
302 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
303 SMR_Bind_sequence, hf_index, ett_smrse_SMR_Bind);
311 dissect_smrse_IMSI_Address(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
312 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
317 static int dissect_moimsi_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
318 return dissect_smrse_IMSI_Address(TRUE, tvb, offset, pinfo, tree, hf_smrse_moimsi);
322 static const ber_sequence_t SMR_Bind_Confirm_sequence[] = {
327 dissect_smrse_SMR_Bind_Confirm(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
328 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
329 SMR_Bind_Confirm_sequence, hf_index, ett_smrse_SMR_Bind_Confirm);
335 static const value_string smrse_Connect_fail_vals[] = {
336 { 0, "not-entitled" },
337 { 1, "tmp-overload" },
338 { 2, "tmp-failure" },
339 { 3, "id-or-passwd" },
340 { 4, "not-supported" },
341 { 5, "inv-SC-addr" },
347 dissect_smrse_Connect_fail(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
348 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
353 static int dissect_connect_fail_reason(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
354 return dissect_smrse_Connect_fail(FALSE, tvb, offset, pinfo, tree, hf_smrse_connect_fail_reason);
358 static const ber_sequence_t SMR_Bind_Failure_sequence[] = {
359 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_connect_fail_reason },
364 dissect_smrse_SMR_Bind_Failure(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
365 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
366 SMR_Bind_Failure_sequence, hf_index, ett_smrse_SMR_Bind_Failure);
372 static const ber_sequence_t SMR_Unbind_sequence[] = {
377 dissect_smrse_SMR_Unbind(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
378 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
379 SMR_Unbind_sequence, hf_index, ett_smrse_SMR_Unbind);
387 dissect_smrse_BOOLEAN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
388 offset = dissect_ber_boolean(implicit_tag, pinfo, tree, tvb, offset, hf_index);
392 static int dissect_mt_priority_request(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
393 return dissect_smrse_BOOLEAN(FALSE, tvb, offset, pinfo, tree, hf_smrse_mt_priority_request);
395 static int dissect_mt_mms(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
396 return dissect_smrse_BOOLEAN(FALSE, tvb, offset, pinfo, tree, hf_smrse_mt_mms);
398 static int dissect_msg_waiting_set(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
399 return dissect_smrse_BOOLEAN(FALSE, tvb, offset, pinfo, tree, hf_smrse_msg_waiting_set);
405 dissect_smrse_RP_MR(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
406 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
411 static int dissect_mt_message_reference(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
412 return dissect_smrse_RP_MR(FALSE, tvb, offset, pinfo, tree, hf_smrse_mt_message_reference);
414 static int dissect_mo_message_reference(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
415 return dissect_smrse_RP_MR(FALSE, tvb, offset, pinfo, tree, hf_smrse_mo_message_reference);
417 static int dissect_message_reference(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
418 return dissect_smrse_RP_MR(FALSE, tvb, offset, pinfo, tree, hf_smrse_message_reference);
424 dissect_smrse_RP_UD(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
425 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
430 static int dissect_mt_user_data(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
431 return dissect_smrse_RP_UD(FALSE, tvb, offset, pinfo, tree, hf_smrse_mt_user_data);
433 static int dissect_mo_user_data(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
434 return dissect_smrse_RP_UD(FALSE, tvb, offset, pinfo, tree, hf_smrse_mo_user_data);
436 static int dissect_sm_diag_info_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
437 return dissect_smrse_RP_UD(TRUE, tvb, offset, pinfo, tree, hf_smrse_sm_diag_info);
443 dissect_smrse_SM_TC(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
444 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
449 static int dissect_mt_tariffClass_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
450 return dissect_smrse_SM_TC(TRUE, tvb, offset, pinfo, tree, hf_smrse_mt_tariffClass);
454 static const ber_sequence_t RPDataMT_sequence[] = {
455 { BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_NOOWNTAG, dissect_mt_priority_request },
456 { BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_NOOWNTAG, dissect_mt_mms },
457 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_mt_message_reference },
458 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_mt_originating_address },
459 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_mt_destination_address },
460 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_mt_user_data },
461 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_mt_origVMSCAddr_impl },
462 { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_mt_tariffClass_impl },
467 dissect_smrse_RPDataMT(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
468 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
469 RPDataMT_sequence, hf_index, ett_smrse_RPDataMT);
475 static const ber_sequence_t RPDataMO_sequence[] = {
476 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_mo_message_reference },
477 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_mo_originating_address },
478 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_mo_user_data },
479 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_origVMSCAddr_impl },
480 { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_moimsi_impl },
485 dissect_smrse_RPDataMO(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
486 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
487 RPDataMO_sequence, hf_index, ett_smrse_RPDataMO);
493 static const ber_sequence_t RPAck_sequence[] = {
494 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_message_reference },
499 dissect_smrse_RPAck(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
500 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
501 RPAck_sequence, hf_index, ett_smrse_RPAck);
507 static const value_string smrse_Error_reason_vals[] = {
508 { 1, "unknown-subscriber" },
509 { 9, "illegal-subscriber" },
510 { 11, "teleservice-not-provisioned" },
511 { 13, "call-barred" },
512 { 15, "cug-reject" },
513 { 19, "sMS-ll-capabilities-not-prov" },
514 { 20, "error-in-MS" },
515 { 21, "facility-not-supported" },
516 { 22, "memory-capacity-exceeded" },
517 { 29, "absent-subscriber" },
518 { 30, "ms-busy-for-MT-sms" },
519 { 36, "system-failure" },
520 { 44, "illegal-equipment" },
521 { 60, "no-resp-to-paging" },
522 { 61, "gMSC-congestion" },
523 { 70, "dublicate-sm" },
524 { 101, "sC-congestion" },
525 { 103, "mS-not-SC-Subscriber" },
526 { 104, "invalid-sme-address" },
532 dissect_smrse_Error_reason(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
533 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
538 static int dissect_error_reason(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_) {
539 return dissect_smrse_Error_reason(FALSE, tvb, offset, pinfo, tree, hf_smrse_error_reason);
543 static const ber_sequence_t RPError_sequence[] = {
544 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_error_reason },
545 { BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_NOOWNTAG, dissect_msg_waiting_set },
546 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_message_reference },
547 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_alerting_MS_ISDN_impl },
548 { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_sm_diag_info_impl },
553 dissect_smrse_RPError(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
554 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
555 RPError_sequence, hf_index, ett_smrse_RPError);
561 static const ber_sequence_t RPAlertSC_sequence[] = {
562 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ms_address },
563 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_message_reference },
568 dissect_smrse_RPAlertSC(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
569 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
570 RPAlertSC_sequence, hf_index, ett_smrse_RPAlertSC);
576 /*--- End of included file: packet-smrse-fn.c ---*/
577 #line 60 "packet-smrse-template.c"
579 static const value_string tag_vals[] = {
581 { 2, "AliveTestRsp" },
595 dissect_smrse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
597 proto_item *item = NULL;
598 proto_tree *tree = NULL;
599 guint8 reserved, tag;
603 reserved=tvb_get_guint8(tvb, 0);
604 length=tvb_get_ntohs(tvb,1);
605 tag=tvb_get_guint8(tvb, 3);
609 if( (tag<1)||(tag>11) )
613 item = proto_tree_add_item(parent_tree, proto_smrse, tvb, 0, -1, FALSE);
614 tree = proto_item_add_subtree(item, ett_smrse);
617 if (check_col(pinfo->cinfo, COL_PROTOCOL))
618 col_set_str(pinfo->cinfo, COL_PROTOCOL, "SMRSE");
619 if (check_col(pinfo->cinfo, COL_INFO))
620 col_set_str(pinfo->cinfo, COL_INFO, val_to_str(tag, tag_vals,"Unknown Tag:0x%02x"));
622 proto_tree_add_item(tree, hf_smrse_reserved, tvb, 0, 1, FALSE);
623 proto_tree_add_item(tree, hf_smrse_length, tvb, 1, 2, FALSE);
624 proto_tree_add_item(tree, hf_smrse_tag, tvb, 3, 1, FALSE);
632 offset=dissect_smrse_SMR_Bind(FALSE, tvb, 4, pinfo, tree, -1);
635 offset=dissect_smrse_SMR_Bind_Confirm(FALSE, tvb, 4, pinfo, tree, -1);
638 offset=dissect_smrse_SMR_Bind_Failure(FALSE, tvb, 4, pinfo, tree, -1);
641 offset=dissect_smrse_SMR_Unbind(FALSE, tvb, 4, pinfo, tree, -1);
644 offset=dissect_smrse_RPDataMT(FALSE, tvb, 4, pinfo, tree, -1);
647 offset=dissect_smrse_RPDataMO(FALSE, tvb, 4, pinfo, tree, -1);
650 offset=dissect_smrse_RPAck(FALSE, tvb, 4, pinfo, tree, -1);
653 offset=dissect_smrse_RPError(FALSE, tvb, 4, pinfo, tree, -1);
656 offset=dissect_smrse_RPAlertSC(FALSE, tvb, 4, pinfo, tree, -1);
663 /*--- proto_register_smrse ----------------------------------------------*/
664 void proto_register_smrse(void) {
667 static hf_register_info hf[] = {
668 { &hf_smrse_reserved, {
669 "Reserved", "smrse.reserved", FT_UINT8, BASE_DEC,
670 NULL, 0, "Reserved byte, must be 126", HFILL }},
672 "Tag", "smrse.tag", FT_UINT8, BASE_DEC,
673 VALS(tag_vals), 0, "Tag", HFILL }},
674 { &hf_smrse_length, {
675 "Length", "smrse.length", FT_UINT16, BASE_DEC,
676 NULL, 0, "Length of SMRSE PDU", HFILL }},
677 { &hf_smrse_Octet_Format,
678 { "octet-Format", "smrse.octet_Format",
679 FT_STRING, BASE_HEX, NULL, 0,
680 "SMS-Address/address-value/octet-format", HFILL }},
683 /*--- Included file: packet-smrse-hfarr.c ---*/
684 #line 1 "packet-smrse-hfarr.c"
685 { &hf_smrse_sc_address,
686 { "sc-address", "smrse.sc_address",
687 FT_NONE, BASE_NONE, NULL, 0,
688 "smrse.SMS_Address", HFILL }},
689 { &hf_smrse_password,
690 { "password", "smrse.password",
691 FT_STRING, BASE_NONE, NULL, 0,
692 "smrse.Password", HFILL }},
693 { &hf_smrse_address_type,
694 { "address-type", "smrse.address_type",
695 FT_INT32, BASE_DEC, VALS(smrse_T_address_type_vals), 0,
696 "smrse.T_address_type", HFILL }},
697 { &hf_smrse_numbering_plan,
698 { "numbering-plan", "smrse.numbering_plan",
699 FT_INT32, BASE_DEC, VALS(smrse_T_numbering_plan_vals), 0,
700 "smrse.T_numbering_plan", HFILL }},
701 { &hf_smrse_address_value,
702 { "address-value", "smrse.address_value",
703 FT_UINT32, BASE_DEC, VALS(smrse_T_address_value_vals), 0,
704 "smrse.T_address_value", HFILL }},
705 { &hf_smrse_octet_format,
706 { "octet-format", "smrse.octet_format",
707 FT_BYTES, BASE_HEX, NULL, 0,
708 "smrse.T_octet_format", HFILL }},
709 { &hf_smrse_connect_fail_reason,
710 { "connect-fail-reason", "smrse.connect_fail_reason",
711 FT_INT32, BASE_DEC, VALS(smrse_Connect_fail_vals), 0,
712 "smrse.Connect_fail", HFILL }},
713 { &hf_smrse_mt_priority_request,
714 { "mt-priority-request", "smrse.mt_priority_request",
715 FT_BOOLEAN, 8, NULL, 0,
716 "smrse.BOOLEAN", HFILL }},
718 { "mt-mms", "smrse.mt_mms",
719 FT_BOOLEAN, 8, NULL, 0,
720 "smrse.BOOLEAN", HFILL }},
721 { &hf_smrse_mt_message_reference,
722 { "mt-message-reference", "smrse.mt_message_reference",
723 FT_UINT32, BASE_DEC, NULL, 0,
724 "smrse.RP_MR", HFILL }},
725 { &hf_smrse_mt_originating_address,
726 { "mt-originating-address", "smrse.mt_originating_address",
727 FT_NONE, BASE_NONE, NULL, 0,
728 "smrse.SMS_Address", HFILL }},
729 { &hf_smrse_mt_destination_address,
730 { "mt-destination-address", "smrse.mt_destination_address",
731 FT_NONE, BASE_NONE, NULL, 0,
732 "smrse.SMS_Address", HFILL }},
733 { &hf_smrse_mt_user_data,
734 { "mt-user-data", "smrse.mt_user_data",
735 FT_BYTES, BASE_HEX, NULL, 0,
736 "smrse.RP_UD", HFILL }},
737 { &hf_smrse_mt_origVMSCAddr,
738 { "mt-origVMSCAddr", "smrse.mt_origVMSCAddr",
739 FT_NONE, BASE_NONE, NULL, 0,
740 "smrse.SMS_Address", HFILL }},
741 { &hf_smrse_mt_tariffClass,
742 { "mt-tariffClass", "smrse.mt_tariffClass",
743 FT_UINT32, BASE_DEC, NULL, 0,
744 "smrse.SM_TC", HFILL }},
745 { &hf_smrse_mo_message_reference,
746 { "mo-message-reference", "smrse.mo_message_reference",
747 FT_UINT32, BASE_DEC, NULL, 0,
748 "smrse.RP_MR", HFILL }},
749 { &hf_smrse_mo_originating_address,
750 { "mo-originating-address", "smrse.mo_originating_address",
751 FT_NONE, BASE_NONE, NULL, 0,
752 "smrse.SMS_Address", HFILL }},
753 { &hf_smrse_mo_user_data,
754 { "mo-user-data", "smrse.mo_user_data",
755 FT_BYTES, BASE_HEX, NULL, 0,
756 "smrse.RP_UD", HFILL }},
757 { &hf_smrse_origVMSCAddr,
758 { "origVMSCAddr", "smrse.origVMSCAddr",
759 FT_NONE, BASE_NONE, NULL, 0,
760 "smrse.SMS_Address", HFILL }},
762 { "moimsi", "smrse.moimsi",
763 FT_BYTES, BASE_HEX, NULL, 0,
764 "smrse.IMSI_Address", HFILL }},
765 { &hf_smrse_message_reference,
766 { "message-reference", "smrse.message_reference",
767 FT_UINT32, BASE_DEC, NULL, 0,
768 "smrse.RP_MR", HFILL }},
769 { &hf_smrse_error_reason,
770 { "error-reason", "smrse.error_reason",
771 FT_INT32, BASE_DEC, VALS(smrse_Error_reason_vals), 0,
772 "smrse.Error_reason", HFILL }},
773 { &hf_smrse_msg_waiting_set,
774 { "msg-waiting-set", "smrse.msg_waiting_set",
775 FT_BOOLEAN, 8, NULL, 0,
776 "smrse.BOOLEAN", HFILL }},
777 { &hf_smrse_alerting_MS_ISDN,
778 { "alerting-MS-ISDN", "smrse.alerting_MS_ISDN",
779 FT_NONE, BASE_NONE, NULL, 0,
780 "smrse.SMS_Address", HFILL }},
781 { &hf_smrse_sm_diag_info,
782 { "sm-diag-info", "smrse.sm_diag_info",
783 FT_BYTES, BASE_HEX, NULL, 0,
784 "smrse.RP_UD", HFILL }},
785 { &hf_smrse_ms_address,
786 { "ms-address", "smrse.ms_address",
787 FT_NONE, BASE_NONE, NULL, 0,
788 "smrse.SMS_Address", HFILL }},
790 /*--- End of included file: packet-smrse-hfarr.c ---*/
791 #line 165 "packet-smrse-template.c"
794 /* List of subtrees */
795 static gint *ett[] = {
798 /*--- Included file: packet-smrse-ettarr.c ---*/
799 #line 1 "packet-smrse-ettarr.c"
801 &ett_smrse_SMS_Address,
802 &ett_smrse_T_address_value,
803 &ett_smrse_SMR_Bind_Confirm,
804 &ett_smrse_SMR_Bind_Failure,
805 &ett_smrse_SMR_Unbind,
810 &ett_smrse_RPAlertSC,
812 /*--- End of included file: packet-smrse-ettarr.c ---*/
813 #line 171 "packet-smrse-template.c"
816 /* Register protocol */
817 proto_smrse = proto_register_protocol(PNAME, PSNAME, PFNAME);
819 /* Register fields and subtrees */
820 proto_register_field_array(proto_smrse, hf, array_length(hf));
821 proto_register_subtree_array(ett, array_length(ett));
826 /*--- proto_reg_handoff_smrse -------------------------------------------*/
827 void proto_reg_handoff_smrse(void) {
828 dissector_handle_t smrse_handle;
830 smrse_handle = new_create_dissector_handle(dissect_smrse, proto_smrse);
831 dissector_add("tcp.port",TCP_PORT_SMRSE, smrse_handle);