1 /* Do not modify this file. */
2 /* It is created automatically by the ASN.1 to Ethereal dissector compiler */
4 /* ../../tools/asn2eth.py -X -b -k -e -p smrse -c smrse.cnf -s packet-smrse-template SMRSE.asn */
6 /* Input file: packet-smrse-template.c */
9 * Routines for SMRSE Short Message Relay Service packet dissection
10 * Ronnie Sahlberg 2004
12 * $Id: packet-smrse-template.c 12245 2004-10-08 20:28:04Z guy $
14 * Ethereal - Network traffic analyzer
15 * By Gerald Combs <gerald@ethereal.com>
16 * Copyright 1998 Gerald Combs
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version 2
21 * of the License, or (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
38 #include <epan/packet.h>
39 #include <epan/conversation.h>
44 #include "packet-ber.h"
45 #include "packet-smrse.h"
47 #define PNAME "Short Message Relaying Service"
48 #define PSNAME "SMRSE"
49 #define PFNAME "smrse"
51 #define TCP_PORT_SMRSE 4321
53 /* Initialize the protocol and registered fields */
55 static int hf_smrse_reserved = -1;
56 static int hf_smrse_tag = -1;
57 static int hf_smrse_length = -1;
58 static int hf_smrse_Octet_Format = -1;
60 /*--- Included file: packet-smrse-hf.c ---*/
62 static int hf_smrse_sc_address = -1; /* SMS_Address */
63 static int hf_smrse_password = -1; /* Password */
64 static int hf_smrse_address_type = -1; /* T_address_type */
65 static int hf_smrse_numbering_plan = -1; /* T_numbering_plan */
66 static int hf_smrse_address_value = -1; /* T_address_value */
67 static int hf_smrse_octet_format = -1; /* T_octet_format */
68 static int hf_smrse_connect_fail_reason = -1; /* Connect_fail */
69 static int hf_smrse_mt_priority_request = -1; /* BOOLEAN */
70 static int hf_smrse_mt_mms = -1; /* BOOLEAN */
71 static int hf_smrse_mt_message_reference = -1; /* RP_MR */
72 static int hf_smrse_mt_originating_address = -1; /* SMS_Address */
73 static int hf_smrse_mt_destination_address = -1; /* SMS_Address */
74 static int hf_smrse_mt_user_data = -1; /* RP_UD */
75 static int hf_smrse_mt_origVMSCAddr = -1; /* SMS_Address */
76 static int hf_smrse_mt_tariffClass = -1; /* SM_TC */
77 static int hf_smrse_mo_message_reference = -1; /* RP_MR */
78 static int hf_smrse_mo_originating_address = -1; /* SMS_Address */
79 static int hf_smrse_mo_user_data = -1; /* RP_UD */
80 static int hf_smrse_origVMSCAddr = -1; /* SMS_Address */
81 static int hf_smrse_moimsi = -1; /* IMSI_Address */
82 static int hf_smrse_message_reference = -1; /* RP_MR */
83 static int hf_smrse_error_reason = -1; /* Error_reason */
84 static int hf_smrse_msg_waiting_set = -1; /* BOOLEAN */
85 static int hf_smrse_alerting_MS_ISDN = -1; /* SMS_Address */
86 static int hf_smrse_sm_diag_info = -1; /* RP_UD */
87 static int hf_smrse_ms_address = -1; /* SMS_Address */
89 /*--- End of included file: packet-smrse-hf.c ---*/
92 /* Initialize the subtree pointers */
93 static gint ett_smrse = -1;
95 /*--- Included file: packet-smrse-ett.c ---*/
97 static gint ett_smrse_SMR_Bind = -1;
98 static gint ett_smrse_SMS_Address = -1;
99 static gint ett_smrse_T_address_value = -1;
100 static gint ett_smrse_SMR_Bind_Confirm = -1;
101 static gint ett_smrse_SMR_Bind_Failure = -1;
102 static gint ett_smrse_SMR_Unbind = -1;
103 static gint ett_smrse_RPDataMT = -1;
104 static gint ett_smrse_RPDataMO = -1;
105 static gint ett_smrse_RPAck = -1;
106 static gint ett_smrse_RPError = -1;
107 static gint ett_smrse_RPAlertSC = -1;
109 /*--- End of included file: packet-smrse-ett.c ---*/
114 /*--- Included file: packet-smrse-fn.c ---*/
116 /*--- Fields for imported types ---*/
120 static const value_string T_address_type_vals[] = {
121 { 0, "unknown-type" },
122 { 1, "internat-number" },
123 { 2, "national-number" },
124 { 3, "net-spec-number" },
125 { 4, "short-number" },
131 dissect_smrse_T_address_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
132 offset = dissect_ber_integer_new(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
136 static int dissect_address_type(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
137 return dissect_smrse_T_address_type(FALSE, tvb, offset, pinfo, tree, hf_smrse_address_type);
141 static const value_string T_numbering_plan_vals[] = {
142 { 0, "unknown-numbering" },
143 { 1, "iSDN-numbering" },
144 { 3, "data-network-numbering" },
145 { 4, "telex-numbering" },
146 { 8, "national-numbering" },
147 { 9, "private-numbering" },
153 dissect_smrse_T_numbering_plan(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
154 offset = dissect_ber_integer_new(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
158 static int dissect_numbering_plan(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
159 return dissect_smrse_T_numbering_plan(FALSE, tvb, offset, pinfo, tree, hf_smrse_numbering_plan);
164 dissect_smrse_SemiOctetString(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
165 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
173 dissect_smrse_T_octet_format(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
174 char *strp,tmpstr[21];
175 guint32 i, start_offset;
180 static char n2a[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
184 /* skip the tag and length */
185 offset=dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag);
186 offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, &ind);
192 *strp++=n2a[tvb_get_guint8(tvb, offset)&0x0f];
193 *strp++=n2a[(tvb_get_guint8(tvb, offset)>>4)&0x0f];
198 proto_tree_add_string(tree, hf_smrse_Octet_Format, tvb, start_offset, offset-start_offset, tmpstr);
205 static int dissect_octet_format(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
206 return dissect_smrse_T_octet_format(FALSE, tvb, offset, pinfo, tree, hf_smrse_octet_format);
210 static const value_string T_address_value_vals[] = {
211 { 0, "octet-format" },
215 static const ber_choice T_address_value_choice[] = {
216 { 0, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_octet_format },
221 dissect_smrse_T_address_value(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
222 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
223 T_address_value_choice, hf_index, ett_smrse_T_address_value);
227 static int dissect_address_value(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
228 return dissect_smrse_T_address_value(FALSE, tvb, offset, pinfo, tree, hf_smrse_address_value);
231 static const ber_sequence SMS_Address_sequence[] = {
232 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_address_type },
233 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_numbering_plan },
234 { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_address_value },
239 dissect_smrse_SMS_Address(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
240 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
241 SMS_Address_sequence, hf_index, ett_smrse_SMS_Address);
245 static int dissect_sc_address(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
246 return dissect_smrse_SMS_Address(FALSE, tvb, offset, pinfo, tree, hf_smrse_sc_address);
248 static int dissect_mt_originating_address(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
249 return dissect_smrse_SMS_Address(FALSE, tvb, offset, pinfo, tree, hf_smrse_mt_originating_address);
251 static int dissect_mt_destination_address(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
252 return dissect_smrse_SMS_Address(FALSE, tvb, offset, pinfo, tree, hf_smrse_mt_destination_address);
254 static int dissect_mt_origVMSCAddr_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
255 return dissect_smrse_SMS_Address(TRUE, tvb, offset, pinfo, tree, hf_smrse_mt_origVMSCAddr);
257 static int dissect_mo_originating_address(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
258 return dissect_smrse_SMS_Address(FALSE, tvb, offset, pinfo, tree, hf_smrse_mo_originating_address);
260 static int dissect_origVMSCAddr_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
261 return dissect_smrse_SMS_Address(TRUE, tvb, offset, pinfo, tree, hf_smrse_origVMSCAddr);
263 static int dissect_alerting_MS_ISDN_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
264 return dissect_smrse_SMS_Address(TRUE, tvb, offset, pinfo, tree, hf_smrse_alerting_MS_ISDN);
266 static int dissect_ms_address(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
267 return dissect_smrse_SMS_Address(FALSE, tvb, offset, pinfo, tree, hf_smrse_ms_address);
272 dissect_smrse_Password(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
273 offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString,
274 pinfo, tree, tvb, offset, hf_index,
279 static int dissect_password(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
280 return dissect_smrse_Password(FALSE, tvb, offset, pinfo, tree, hf_smrse_password);
283 static const ber_sequence SMR_Bind_sequence[] = {
284 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_sc_address },
285 { BER_CLASS_UNI, BER_UNI_TAG_PrintableString, BER_FLAGS_NOOWNTAG, dissect_password },
290 dissect_smrse_SMR_Bind(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
291 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
292 SMR_Bind_sequence, hf_index, ett_smrse_SMR_Bind);
299 dissect_smrse_IMSI_Address(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
300 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
305 static int dissect_moimsi_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
306 return dissect_smrse_IMSI_Address(TRUE, tvb, offset, pinfo, tree, hf_smrse_moimsi);
309 static const ber_sequence SMR_Bind_Confirm_sequence[] = {
314 dissect_smrse_SMR_Bind_Confirm(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
315 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
316 SMR_Bind_Confirm_sequence, hf_index, ett_smrse_SMR_Bind_Confirm);
322 static const value_string Connect_fail_vals[] = {
323 { 0, "not-entitled" },
324 { 1, "tmp-overload" },
325 { 2, "tmp-failure" },
326 { 3, "id-or-passwd" },
327 { 4, "not-supported" },
328 { 5, "inv-SC-addr" },
334 dissect_smrse_Connect_fail(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
335 offset = dissect_ber_integer_new(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
339 static int dissect_connect_fail_reason(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
340 return dissect_smrse_Connect_fail(FALSE, tvb, offset, pinfo, tree, hf_smrse_connect_fail_reason);
343 static const ber_sequence SMR_Bind_Failure_sequence[] = {
344 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_connect_fail_reason },
349 dissect_smrse_SMR_Bind_Failure(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
350 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
351 SMR_Bind_Failure_sequence, hf_index, ett_smrse_SMR_Bind_Failure);
356 static const ber_sequence SMR_Unbind_sequence[] = {
361 dissect_smrse_SMR_Unbind(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
362 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
363 SMR_Unbind_sequence, hf_index, ett_smrse_SMR_Unbind);
370 dissect_smrse_BOOLEAN(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
371 offset = dissect_ber_boolean(pinfo, tree, tvb, offset, hf_index);
375 static int dissect_mt_priority_request(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
376 return dissect_smrse_BOOLEAN(FALSE, tvb, offset, pinfo, tree, hf_smrse_mt_priority_request);
378 static int dissect_mt_mms(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
379 return dissect_smrse_BOOLEAN(FALSE, tvb, offset, pinfo, tree, hf_smrse_mt_mms);
381 static int dissect_msg_waiting_set(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
382 return dissect_smrse_BOOLEAN(FALSE, tvb, offset, pinfo, tree, hf_smrse_msg_waiting_set);
388 dissect_smrse_RP_MR(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
389 offset = dissect_ber_integer_new(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
393 static int dissect_mt_message_reference(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
394 return dissect_smrse_RP_MR(FALSE, tvb, offset, pinfo, tree, hf_smrse_mt_message_reference);
396 static int dissect_mo_message_reference(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
397 return dissect_smrse_RP_MR(FALSE, tvb, offset, pinfo, tree, hf_smrse_mo_message_reference);
399 static int dissect_message_reference(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
400 return dissect_smrse_RP_MR(FALSE, tvb, offset, pinfo, tree, hf_smrse_message_reference);
405 dissect_smrse_RP_UD(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
406 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
411 static int dissect_mt_user_data(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
412 return dissect_smrse_RP_UD(FALSE, tvb, offset, pinfo, tree, hf_smrse_mt_user_data);
414 static int dissect_mo_user_data(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
415 return dissect_smrse_RP_UD(FALSE, tvb, offset, pinfo, tree, hf_smrse_mo_user_data);
417 static int dissect_sm_diag_info_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
418 return dissect_smrse_RP_UD(TRUE, tvb, offset, pinfo, tree, hf_smrse_sm_diag_info);
424 dissect_smrse_SM_TC(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
425 offset = dissect_ber_integer_new(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
429 static int dissect_mt_tariffClass_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
430 return dissect_smrse_SM_TC(TRUE, tvb, offset, pinfo, tree, hf_smrse_mt_tariffClass);
433 static const ber_sequence RPDataMT_sequence[] = {
434 { BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_NOOWNTAG, dissect_mt_priority_request },
435 { BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_NOOWNTAG, dissect_mt_mms },
436 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_mt_message_reference },
437 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_mt_originating_address },
438 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_mt_destination_address },
439 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_mt_user_data },
440 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_mt_origVMSCAddr_impl },
441 { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_mt_tariffClass_impl },
446 dissect_smrse_RPDataMT(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
447 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
448 RPDataMT_sequence, hf_index, ett_smrse_RPDataMT);
453 static const ber_sequence RPDataMO_sequence[] = {
454 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_mo_message_reference },
455 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_mo_originating_address },
456 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_mo_user_data },
457 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_origVMSCAddr_impl },
458 { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_moimsi_impl },
463 dissect_smrse_RPDataMO(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
464 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
465 RPDataMO_sequence, hf_index, ett_smrse_RPDataMO);
470 static const ber_sequence RPAck_sequence[] = {
471 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_message_reference },
476 dissect_smrse_RPAck(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
477 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
478 RPAck_sequence, hf_index, ett_smrse_RPAck);
484 static const value_string Error_reason_vals[] = {
485 { 1, "unknown-subscriber" },
486 { 9, "illegal-subscriber" },
487 { 11, "teleservice-not-provisioned" },
488 { 13, "call-barred" },
489 { 15, "cug-reject" },
490 { 19, "sMS-ll-capabilities-not-prov" },
491 { 20, "error-in-MS" },
492 { 21, "facility-not-supported" },
493 { 22, "memory-capacity-exceeded" },
494 { 29, "absent-subscriber" },
495 { 30, "ms-busy-for-MT-sms" },
496 { 36, "system-failure" },
497 { 44, "illegal-equipment" },
498 { 60, "no-resp-to-paging" },
499 { 61, "gMSC-congestion" },
500 { 70, "dublicate-sm" },
501 { 101, "sC-congestion" },
502 { 103, "mS-not-SC-Subscriber" },
503 { 104, "invalid-sme-address" },
509 dissect_smrse_Error_reason(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
510 offset = dissect_ber_integer_new(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
514 static int dissect_error_reason(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
515 return dissect_smrse_Error_reason(FALSE, tvb, offset, pinfo, tree, hf_smrse_error_reason);
518 static const ber_sequence RPError_sequence[] = {
519 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_error_reason },
520 { BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_NOOWNTAG, dissect_msg_waiting_set },
521 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_message_reference },
522 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_alerting_MS_ISDN_impl },
523 { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_sm_diag_info_impl },
528 dissect_smrse_RPError(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
529 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
530 RPError_sequence, hf_index, ett_smrse_RPError);
535 static const ber_sequence RPAlertSC_sequence[] = {
536 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ms_address },
537 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_message_reference },
542 dissect_smrse_RPAlertSC(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
543 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
544 RPAlertSC_sequence, hf_index, ett_smrse_RPAlertSC);
550 /*--- End of included file: packet-smrse-fn.c ---*/
553 static const value_string tag_vals[] = {
555 { 2, "AliveTestRsp" },
569 dissect_smrse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
571 proto_item *item = NULL;
572 proto_tree *tree = NULL;
573 guint8 reserved, tag;
577 reserved=tvb_get_guint8(tvb, 0);
578 length=tvb_get_ntohs(tvb,1);
579 tag=tvb_get_guint8(tvb, 3);
583 if( (tag<1)||(tag>11) )
587 item = proto_tree_add_item(parent_tree, proto_smrse, tvb, 0, -1, FALSE);
588 tree = proto_item_add_subtree(item, ett_smrse);
591 if (check_col(pinfo->cinfo, COL_PROTOCOL))
592 col_set_str(pinfo->cinfo, COL_PROTOCOL, "SMRSE");
593 if (check_col(pinfo->cinfo, COL_INFO))
594 col_set_str(pinfo->cinfo, COL_INFO, val_to_str(tag, tag_vals,"Unknown Tag:0x%02x"));
596 proto_tree_add_item(tree, hf_smrse_reserved, tvb, 0, 1, FALSE);
597 proto_tree_add_item(tree, hf_smrse_length, tvb, 1, 2, FALSE);
598 proto_tree_add_item(tree, hf_smrse_tag, tvb, 3, 1, FALSE);
606 offset=dissect_smrse_SMR_Bind(FALSE, tvb, 4, pinfo, tree, -1);
609 offset=dissect_smrse_SMR_Bind_Confirm(FALSE, tvb, 4, pinfo, tree, -1);
612 offset=dissect_smrse_SMR_Bind_Failure(FALSE, tvb, 4, pinfo, tree, -1);
615 offset=dissect_smrse_SMR_Unbind(FALSE, tvb, 4, pinfo, tree, -1);
618 offset=dissect_smrse_RPDataMT(FALSE, tvb, 4, pinfo, tree, -1);
621 offset=dissect_smrse_RPDataMO(FALSE, tvb, 4, pinfo, tree, -1);
624 offset=dissect_smrse_RPAck(FALSE, tvb, 4, pinfo, tree, -1);
627 offset=dissect_smrse_RPError(FALSE, tvb, 4, pinfo, tree, -1);
630 offset=dissect_smrse_RPAlertSC(FALSE, tvb, 4, pinfo, tree, -1);
637 /*--- proto_register_smrse ----------------------------------------------*/
638 void proto_register_smrse(void) {
641 static hf_register_info hf[] = {
642 { &hf_smrse_reserved, {
643 "Reserved", "smrse.reserved", FT_UINT8, BASE_DEC,
644 NULL, 0, "Reserved byte, must be 126", HFILL }},
646 "Tag", "smrse.tag", FT_UINT8, BASE_DEC,
647 VALS(tag_vals), 0, "Tag", HFILL }},
648 { &hf_smrse_length, {
649 "Length", "smrse.length", FT_UINT16, BASE_DEC,
650 NULL, 0, "Length of SMRSE PDU", HFILL }},
651 { &hf_smrse_Octet_Format,
652 { "octet-Format", "smrse.octet_Format",
653 FT_STRING, BASE_HEX, NULL, 0,
654 "SMS-Address/address-value/octet-format", HFILL }},
657 /*--- Included file: packet-smrse-hfarr.c ---*/
659 { &hf_smrse_sc_address,
660 { "sc-address", "smrse.sc_address",
661 FT_NONE, BASE_NONE, NULL, 0,
662 "SMR-Bind/sc-address", HFILL }},
663 { &hf_smrse_password,
664 { "password", "smrse.password",
665 FT_STRING, BASE_NONE, NULL, 0,
666 "SMR-Bind/password", HFILL }},
667 { &hf_smrse_address_type,
668 { "address-type", "smrse.address_type",
669 FT_INT32, BASE_DEC, VALS(T_address_type_vals), 0,
670 "SMS-Address/address-type", HFILL }},
671 { &hf_smrse_numbering_plan,
672 { "numbering-plan", "smrse.numbering_plan",
673 FT_INT32, BASE_DEC, VALS(T_numbering_plan_vals), 0,
674 "SMS-Address/numbering-plan", HFILL }},
675 { &hf_smrse_address_value,
676 { "address-value", "smrse.address_value",
677 FT_UINT32, BASE_DEC, VALS(T_address_value_vals), 0,
678 "SMS-Address/address-value", HFILL }},
679 { &hf_smrse_octet_format,
680 { "octet-format", "smrse.octet_format",
681 FT_BYTES, BASE_HEX, NULL, 0,
682 "SMS-Address/address-value/octet-format", HFILL }},
683 { &hf_smrse_connect_fail_reason,
684 { "connect-fail-reason", "smrse.connect_fail_reason",
685 FT_INT32, BASE_DEC, VALS(Connect_fail_vals), 0,
686 "SMR-Bind-Failure/connect-fail-reason", HFILL }},
687 { &hf_smrse_mt_priority_request,
688 { "mt-priority-request", "smrse.mt_priority_request",
689 FT_BOOLEAN, 8, NULL, 0,
690 "RPDataMT/mt-priority-request", HFILL }},
692 { "mt-mms", "smrse.mt_mms",
693 FT_BOOLEAN, 8, NULL, 0,
694 "RPDataMT/mt-mms", HFILL }},
695 { &hf_smrse_mt_message_reference,
696 { "mt-message-reference", "smrse.mt_message_reference",
697 FT_UINT32, BASE_DEC, NULL, 0,
698 "RPDataMT/mt-message-reference", HFILL }},
699 { &hf_smrse_mt_originating_address,
700 { "mt-originating-address", "smrse.mt_originating_address",
701 FT_NONE, BASE_NONE, NULL, 0,
702 "RPDataMT/mt-originating-address", HFILL }},
703 { &hf_smrse_mt_destination_address,
704 { "mt-destination-address", "smrse.mt_destination_address",
705 FT_NONE, BASE_NONE, NULL, 0,
706 "RPDataMT/mt-destination-address", HFILL }},
707 { &hf_smrse_mt_user_data,
708 { "mt-user-data", "smrse.mt_user_data",
709 FT_BYTES, BASE_HEX, NULL, 0,
710 "RPDataMT/mt-user-data", HFILL }},
711 { &hf_smrse_mt_origVMSCAddr,
712 { "mt-origVMSCAddr", "smrse.mt_origVMSCAddr",
713 FT_NONE, BASE_NONE, NULL, 0,
714 "RPDataMT/mt-origVMSCAddr", HFILL }},
715 { &hf_smrse_mt_tariffClass,
716 { "mt-tariffClass", "smrse.mt_tariffClass",
717 FT_UINT32, BASE_DEC, NULL, 0,
718 "RPDataMT/mt-tariffClass", HFILL }},
719 { &hf_smrse_mo_message_reference,
720 { "mo-message-reference", "smrse.mo_message_reference",
721 FT_UINT32, BASE_DEC, NULL, 0,
722 "RPDataMO/mo-message-reference", HFILL }},
723 { &hf_smrse_mo_originating_address,
724 { "mo-originating-address", "smrse.mo_originating_address",
725 FT_NONE, BASE_NONE, NULL, 0,
726 "RPDataMO/mo-originating-address", HFILL }},
727 { &hf_smrse_mo_user_data,
728 { "mo-user-data", "smrse.mo_user_data",
729 FT_BYTES, BASE_HEX, NULL, 0,
730 "RPDataMO/mo-user-data", HFILL }},
731 { &hf_smrse_origVMSCAddr,
732 { "origVMSCAddr", "smrse.origVMSCAddr",
733 FT_NONE, BASE_NONE, NULL, 0,
734 "RPDataMO/origVMSCAddr", HFILL }},
736 { "moimsi", "smrse.moimsi",
737 FT_BYTES, BASE_HEX, NULL, 0,
738 "RPDataMO/moimsi", HFILL }},
739 { &hf_smrse_message_reference,
740 { "message-reference", "smrse.message_reference",
741 FT_UINT32, BASE_DEC, NULL, 0,
743 { &hf_smrse_error_reason,
744 { "error-reason", "smrse.error_reason",
745 FT_INT32, BASE_DEC, VALS(Error_reason_vals), 0,
746 "RPError/error-reason", HFILL }},
747 { &hf_smrse_msg_waiting_set,
748 { "msg-waiting-set", "smrse.msg_waiting_set",
749 FT_BOOLEAN, 8, NULL, 0,
750 "RPError/msg-waiting-set", HFILL }},
751 { &hf_smrse_alerting_MS_ISDN,
752 { "alerting-MS-ISDN", "smrse.alerting_MS_ISDN",
753 FT_NONE, BASE_NONE, NULL, 0,
754 "RPError/alerting-MS-ISDN", HFILL }},
755 { &hf_smrse_sm_diag_info,
756 { "sm-diag-info", "smrse.sm_diag_info",
757 FT_BYTES, BASE_HEX, NULL, 0,
758 "RPError/sm-diag-info", HFILL }},
759 { &hf_smrse_ms_address,
760 { "ms-address", "smrse.ms_address",
761 FT_NONE, BASE_NONE, NULL, 0,
762 "RPAlertSC/ms-address", HFILL }},
764 /*--- End of included file: packet-smrse-hfarr.c ---*/
768 /* List of subtrees */
769 static gint *ett[] = {
772 /*--- Included file: packet-smrse-ettarr.c ---*/
775 &ett_smrse_SMS_Address,
776 &ett_smrse_T_address_value,
777 &ett_smrse_SMR_Bind_Confirm,
778 &ett_smrse_SMR_Bind_Failure,
779 &ett_smrse_SMR_Unbind,
784 &ett_smrse_RPAlertSC,
786 /*--- End of included file: packet-smrse-ettarr.c ---*/
790 /* Register protocol */
791 proto_smrse = proto_register_protocol(PNAME, PSNAME, PFNAME);
793 /* Register fields and subtrees */
794 proto_register_field_array(proto_smrse, hf, array_length(hf));
795 proto_register_subtree_array(ett, array_length(ett));
800 /*--- proto_reg_handoff_smrse -------------------------------------------*/
801 void proto_reg_handoff_smrse(void) {
802 dissector_handle_t smrse_handle;
804 smrse_handle = new_create_dissector_handle(dissect_smrse, proto_smrse);
805 dissector_add("tcp.port",TCP_PORT_SMRSE, smrse_handle);