2 * Routines for Short Message Peer to Peer dissection
3 * Copyright 2001, Tom Uijldert.
5 * Data Coding Scheme decoding for GSM (SMS and CBS),
6 * provided by Olivier Biot.
8 * Dissection of multiple SMPP PDUs within one packet
9 * provided by Chris Wilson.
11 * Statistics support using Stats Tree API
12 * provided by Abhik Sarkar
14 * Support for SMPP 5.0
15 * introduced by Abhik Sarkar
19 * Refer to the AUTHORS file or the AUTHORS section in the man page
20 * for contacting the author(s) of this file.
22 * Wireshark - Network traffic analyzer
23 * By Gerald Combs <gerald@wireshark.org>
24 * Copyright 1998 Gerald Combs
26 * This program is free software; you can redistribute it and/or
27 * modify it under the terms of the GNU General Public License
28 * as published by the Free Software Foundation; either version 2
29 * of the License, or (at your option) any later version.
31 * This program is distributed in the hope that it will be useful,
32 * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 * GNU General Public License for more details.
36 * You should have received a copy of the GNU General Public License
37 * along with this program; if not, write to the Free Software
38 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
41 * Dissector of an SMPP (Short Message Peer to Peer) PDU, as defined by the
42 * SMS forum (www.smsforum.net) in "SMPP protocol specification v3.4"
43 * (document version: 12-Oct-1999 Issue 1.2)
57 #include <epan/packet.h>
59 #include <epan/stats_tree.h>
61 #include <epan/prefs.h>
62 #include <epan/emem.h>
63 #include "packet-tcp.h"
64 #include "packet-smpp.h"
66 /* General-purpose debug logger.
67 * Requires double parentheses because of variable arguments of printf().
69 * Enable debug logging for SMPP by defining AM_CFLAGS
70 * so that it contains "-DDEBUG_smpp"
74 g_print("%s:%u: ", __FILE__, __LINE__); \
80 #define SMPP_MIN_LENGTH 16
82 /* Forward declarations */
83 static void dissect_smpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
84 static guint get_smpp_pdu_len(packet_info *pinfo, tvbuff_t *tvb, int offset);
85 static void dissect_smpp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
88 * Initialize the protocol and registered fields
90 * Fixed header section
92 static int proto_smpp = -1;
94 static int st_smpp_ops = -1;
95 static int st_smpp_req = -1;
96 static int st_smpp_res = -1;
97 static int st_smpp_res_status = -1;
99 static int hf_smpp_command_id = -1;
100 static int hf_smpp_command_length = -1;
101 static int hf_smpp_command_status = -1;
102 static int hf_smpp_sequence_number = -1;
107 static int hf_smpp_system_id = -1;
108 static int hf_smpp_password = -1;
109 static int hf_smpp_system_type = -1;
110 static int hf_smpp_interface_version = -1;
111 static int hf_smpp_addr_ton = -1;
112 static int hf_smpp_addr_npi = -1;
113 static int hf_smpp_address_range = -1;
114 static int hf_smpp_service_type = -1;
115 static int hf_smpp_source_addr_ton = -1;
116 static int hf_smpp_source_addr_npi = -1;
117 static int hf_smpp_source_addr = -1;
118 static int hf_smpp_dest_addr_ton = -1;
119 static int hf_smpp_dest_addr_npi = -1;
120 static int hf_smpp_destination_addr = -1;
121 static int hf_smpp_esm_submit_msg_mode = -1;
122 static int hf_smpp_esm_submit_msg_type = -1;
123 static int hf_smpp_esm_submit_features = -1;
124 static int hf_smpp_protocol_id = -1;
125 static int hf_smpp_priority_flag = -1;
126 static int hf_smpp_schedule_delivery_time = -1;
127 static int hf_smpp_schedule_delivery_time_r = -1;
128 static int hf_smpp_validity_period = -1;
129 static int hf_smpp_validity_period_r = -1;
130 static int hf_smpp_regdel_receipt = -1;
131 static int hf_smpp_regdel_acks = -1;
132 static int hf_smpp_regdel_notif = -1;
133 static int hf_smpp_replace_if_present_flag = -1;
134 static int hf_smpp_data_coding = -1;
135 static int hf_smpp_sm_default_msg_id = -1;
136 static int hf_smpp_sm_length = -1;
137 static int hf_smpp_short_message = -1;
138 static int hf_smpp_message_id = -1;
139 static int hf_smpp_dlist = -1;
140 static int hf_smpp_dlist_resp = -1;
141 static int hf_smpp_dl_name = -1;
142 static int hf_smpp_final_date = -1;
143 static int hf_smpp_final_date_r = -1;
144 static int hf_smpp_message_state = -1;
145 static int hf_smpp_error_code = -1;
146 static int hf_smpp_error_status_code = -1;
147 static int hf_smpp_esme_addr_ton = -1;
148 static int hf_smpp_esme_addr_npi = -1;
149 static int hf_smpp_esme_addr = -1;
152 * Optional parameter section
154 static int hf_smpp_opt_params = -1;
155 static int hf_smpp_opt_param = -1;
156 static int hf_smpp_opt_param_tag = -1;
157 static int hf_smpp_opt_param_len = -1;
158 static int hf_smpp_vendor_op = -1;
159 static int hf_smpp_reserved_op = -1;
161 static int hf_smpp_dest_addr_subunit = -1;
162 static int hf_smpp_dest_network_type = -1;
163 static int hf_smpp_dest_bearer_type = -1;
164 static int hf_smpp_dest_telematics_id = -1;
165 static int hf_smpp_source_addr_subunit = -1;
166 static int hf_smpp_source_network_type = -1;
167 static int hf_smpp_source_bearer_type = -1;
168 static int hf_smpp_source_telematics_id = -1;
169 static int hf_smpp_qos_time_to_live = -1;
170 static int hf_smpp_payload_type = -1;
171 static int hf_smpp_additional_status_info_text = -1;
172 static int hf_smpp_receipted_message_id = -1;
173 static int hf_smpp_msg_wait_ind = -1;
174 static int hf_smpp_msg_wait_type = -1;
175 static int hf_smpp_privacy_indicator = -1;
176 static int hf_smpp_source_subaddress = -1;
177 static int hf_smpp_dest_subaddress = -1;
178 static int hf_smpp_user_message_reference = -1;
179 static int hf_smpp_user_response_code = -1;
180 static int hf_smpp_source_port = -1;
181 static int hf_smpp_destination_port = -1;
182 static int hf_smpp_sar_msg_ref_num = -1;
183 static int hf_smpp_language_indicator = -1;
184 static int hf_smpp_sar_total_segments = -1;
185 static int hf_smpp_sar_segment_seqnum = -1;
186 static int hf_smpp_SC_interface_version = -1;
187 static int hf_smpp_callback_num_pres = -1;
188 static int hf_smpp_callback_num_scrn = -1;
189 static int hf_smpp_callback_num_atag = -1;
190 static int hf_smpp_number_of_messages = -1;
191 static int hf_smpp_callback_num = -1;
192 static int hf_smpp_dpf_result = -1;
193 static int hf_smpp_set_dpf = -1;
194 static int hf_smpp_ms_availability_status = -1;
195 static int hf_smpp_network_error_type = -1;
196 static int hf_smpp_network_error_code = -1;
197 static int hf_smpp_message_payload = -1;
198 static int hf_smpp_delivery_failure_reason = -1;
199 static int hf_smpp_more_messages_to_send = -1;
200 static int hf_smpp_ussd_service_op = -1;
201 static int hf_smpp_display_time = -1;
202 static int hf_smpp_sms_signal = -1;
203 static int hf_smpp_ms_validity = -1;
204 static int hf_smpp_alert_on_message_delivery_null = -1;
205 static int hf_smpp_alert_on_message_delivery = -1;
206 static int hf_smpp_its_reply_type = -1;
207 static int hf_smpp_its_session_number = -1;
208 static int hf_smpp_its_session_sequence = -1;
209 static int hf_smpp_its_session_ind = -1;
211 /* Optional Parameters introduced in SMPP 5.0 */
212 static int hf_smpp_congestion_state = -1;
213 static int hf_smpp_billing_identification = -1;
214 static int hf_smpp_dest_addr_np_country = -1;
215 static int hf_smpp_dest_addr_np_information = -1;
216 static int hf_smpp_dest_addr_np_resolution = -1;
217 static int hf_smpp_source_network_id = -1;
218 static int hf_smpp_source_node_id = -1;
219 static int hf_smpp_dest_network_id = -1;
220 static int hf_smpp_dest_node_id = -1;
221 /* Optional Parameters for Cell Broadcast Operations */
222 static int hf_smpp_broadcast_channel_indicator = -1;
223 static int hf_smpp_broadcast_content_type_nw = -1;
224 static int hf_smpp_broadcast_content_type_type = -1;
225 static int hf_smpp_broadcast_content_type_info = -1;
226 static int hf_smpp_broadcast_message_class = -1;
227 static int hf_smpp_broadcast_rep_num = -1;
228 static int hf_smpp_broadcast_frequency_interval_unit = -1;
229 static int hf_smpp_broadcast_frequency_interval_value = -1;
230 static int hf_smpp_broadcast_area_identifier = -1;
231 static int hf_smpp_broadcast_area_identifier_format = -1;
232 static int hf_smpp_broadcast_error_status = -1;
233 static int hf_smpp_broadcast_area_success = -1;
234 static int hf_smpp_broadcast_end_time = -1;
235 static int hf_smpp_broadcast_end_time_r = -1;
236 static int hf_smpp_broadcast_service_group = -1;
239 * Data Coding Scheme section
241 static int hf_smpp_dcs = -1;
242 static int hf_smpp_dcs_sms_coding_group = -1;
243 static int hf_smpp_dcs_text_compression = -1;
244 static int hf_smpp_dcs_class_present = -1;
245 static int hf_smpp_dcs_charset = -1;
246 static int hf_smpp_dcs_class = -1;
247 static int hf_smpp_dcs_cbs_coding_group = -1;
248 static int hf_smpp_dcs_cbs_language = -1;
249 static int hf_smpp_dcs_wap_charset = -1;
250 static int hf_smpp_dcs_wap_class = -1;
251 static int hf_smpp_dcs_cbs_class = -1;
253 /* Initialize the subtree pointers */
254 static gint ett_smpp = -1;
255 static gint ett_dlist = -1;
256 static gint ett_dlist_resp = -1;
257 static gint ett_opt_params = -1;
258 static gint ett_opt_param = -1;
259 static gint ett_dcs = -1;
261 /* Reassemble SMPP TCP segments */
262 static gboolean reassemble_over_tcp = TRUE;
265 static int smpp_tap = -1;
268 static gchar* st_str_smpp = "SMPP Operations";
271 * Value-arrays for field-contents
273 static const value_string vals_command_id[] = { /* Operation */
274 { 0x80000000, "Generic_nack" },
275 { 0x00000001, "Bind_receiver" },
276 { 0x80000001, "Bind_receiver - resp" },
277 { 0x00000002, "Bind_transmitter" },
278 { 0x80000002, "Bind_transmitter - resp" },
279 { 0x00000003, "Query_sm" },
280 { 0x80000003, "Query_sm - resp" },
281 { 0x00000004, "Submit_sm" },
282 { 0x80000004, "Submit_sm - resp" },
283 { 0x00000005, "Deliver_sm" },
284 { 0x80000005, "Deliver_sm - resp" },
285 { 0x00000006, "Unbind" },
286 { 0x80000006, "Unbind - resp" },
287 { 0x00000007, "Replace_sm" },
288 { 0x80000007, "Replace_sm - resp" },
289 { 0x00000008, "Cancel_sm" },
290 { 0x80000008, "Cancel_sm - resp" },
291 { 0x00000009, "Bind_transceiver" },
292 { 0x80000009, "Bind_transceiver - resp" },
293 { 0x0000000B, "Outbind" },
294 { 0x00000015, "Enquire_link" },
295 { 0x80000015, "Enquire_link - resp" },
296 { 0x00000021, "Submit_multi" },
297 { 0x80000021, "Submit_multi - resp" },
298 { 0x00000102, "Alert_notification" },
299 { 0x00000103, "Data_sm" },
300 { 0x80000103, "Data_sm - resp" },
301 /* Introduced in SMPP 5.0 */
302 { 0x00000111, "Broadcast_sm" },
303 { 0x80000111, "Broadcast_sm - resp" },
304 { 0x00000112, "Query_broadcast_sm" },
305 { 0x80000112, "Query_broadcast_sm - resp" },
306 { 0x00000113, "Cancel_broadcast_sm" },
307 { 0x80000113, "Cancel_broadcast_sm - resp" },
311 static const value_string vals_command_status[] = { /* Status */
312 { 0x00000000, "Ok" },
313 { 0x00000001, "Message length is invalid" },
314 { 0x00000002, "Command length is invalid" },
315 { 0x00000003, "Invalid command ID" },
316 { 0x00000004, "Incorrect BIND status for given command" },
317 { 0x00000005, "ESME already in bound state" },
318 { 0x00000006, "Invalid priority flag" },
319 { 0x00000007, "Invalid registered delivery flag" },
320 { 0x00000008, "System error" },
321 { 0x00000009, "[Reserved]" },
322 { 0x0000000A, "Invalid source address" },
323 { 0x0000000B, "Invalid destination address" },
324 { 0x0000000C, "Message ID is invalid" },
325 { 0x0000000D, "Bind failed" },
326 { 0x0000000E, "Invalid password" },
327 { 0x0000000F, "Invalid system ID" },
328 { 0x00000010, "[Reserved]" },
329 { 0x00000011, "Cancel SM failed" },
330 { 0x00000012, "[Reserved]" },
331 { 0x00000013, "Replace SM failed" },
332 { 0x00000014, "Message queue full" },
333 { 0x00000015, "Invalid service type" },
334 { 0x00000033, "Invalid number of destinations" },
335 { 0x00000034, "Invalid distribution list name" },
336 { 0x00000040, "Destination flag is invalid (submit_multi)" },
337 { 0x00000041, "[Reserved]" },
338 { 0x00000042, "Invalid 'submit with replace' request" },
339 { 0x00000043, "Invalid esm_class field data" },
340 { 0x00000044, "Cannot submit to distribution list" },
341 { 0x00000045, "submit_sm or submit_multi failed" },
342 { 0x00000046, "[Reserved]" },
343 { 0x00000047, "[Reserved]" },
344 { 0x00000048, "Invalid source address TON" },
345 { 0x00000049, "Invalid source address NPI" },
346 { 0x00000050, "Invalid destination address TON" },
347 { 0x00000051, "Invalid destination address NPI" },
348 { 0x00000052, "[Reserved]" },
349 { 0x00000053, "Invalid system_type field" },
350 { 0x00000054, "Invalid replace_if_present flag" },
351 { 0x00000055, "Invalid number of messages" },
352 { 0x00000056, "[Reserved]" },
353 { 0x00000057, "[Reserved]" },
354 { 0x00000058, "Throttling error (ESME exceeded allowed message limits)" },
355 { 0x00000059, "[Reserved]" },
356 { 0x00000060, "[Reserved]" },
357 { 0x00000061, "Invalid scheduled delivery time" },
358 { 0x00000062, "Invalid message validity period (expiry time)" },
359 { 0x00000063, "Predefined message invalid or not found" },
360 { 0x00000064, "ESME receiver temporary app error code" },
361 { 0x00000065, "ESME receiver permanent app error code" },
362 { 0x00000066, "ESME receiver reject message error code" },
363 { 0x00000067, "query_sm request failed" },
364 { 0x000000C0, "Error in the optional part of the PDU body" },
365 { 0x000000C1, "Optional parameter not allowed" },
366 { 0x000000C2, "Invalid parameter length" },
367 { 0x000000C3, "Expected optional parameter missing" },
368 { 0x000000C4, "Invalid optional parameter value" },
369 { 0x000000FE, "(Transaction) Delivery failure (used for data_sm_resp)" },
370 { 0x000000FF, "Unknown error" },
371 /* Introduced in SMPP 5.0 */
372 { 0x00000100, "ESME Not authorised to use specified service_type." },
373 { 0x00000101, "ESME Prohibited from using specified operation."},
374 { 0x00000102, "Specified service_type is unavailable." },
375 { 0x00000103, "Specified service_type is denied." },
376 { 0x00000104, "Invalid Data Coding Scheme." },
377 { 0x00000105, "Source Address Sub unit is Invalid." },
378 { 0x00000106, "Destination Address Sub unit is Invalid." },
379 { 0x00000107, "Broadcast Frequency Interval is invalid." },
380 { 0x00000108, "Broadcast Alias Name is invalid." },
381 { 0x00000109, "Broadcast Area Format is invalid." },
382 { 0x0000010A, "Number of Broadcast Areas is invalid." },
383 { 0x0000010B, "Broadcast Content Type is invalid." },
384 { 0x0000010C, "Broadcast Message Class is invalid." },
385 { 0x0000010D, "broadcast_sm operation failed." },
386 { 0x0000010E, "query_broadcast_sm operation failed." },
387 { 0x0000010F, "cancel_broadcast_sm operation failed." },
388 { 0x00000110, "Number of Repeated Broadcasts is invalid." },
389 { 0x00000111, "Broadcast Service Group is invalid." },
390 { 0x00000112, "Broadcast Channel Indicator is invalid." },
394 static const value_string vals_tlv_tags[] = {
395 { 0x0005, "dest_addr_subunit" },
396 { 0x0006, "dest_network_type" },
397 { 0x0007, "dest_bearer_type" },
398 { 0x0008, "dest_telematics_id" },
399 { 0x000D, "source_addr_subunit" },
400 { 0x000E, "source_network_type" },
401 { 0x000F, "source_bearer_type" },
402 { 0x0010, "source_telematics_id" },
403 { 0x0017, "qos_time_to_live" },
404 { 0x0019, "payload_type" },
405 { 0x001D, "additional_status_info_text" },
406 { 0x001E, "receipted_message_id" },
407 { 0x0030, "ms_msg_wait_facilities" },
408 { 0x0201, "privacy_indicator" },
409 { 0x0202, "source_subaddress" },
410 { 0x0203, "dest_subaddress" },
411 { 0x0204, "user_message_reference" },
412 { 0x0205, "user_response_code" },
413 { 0x020A, "source_port" },
414 { 0x020B, "dest_port" },
415 { 0x020C, "sar_msg_ref_num" },
416 { 0x020D, "language_indicator" },
417 { 0x020E, "sar_total_segments" },
418 { 0x020F, "sar_segment_seqnum" },
419 { 0x0210, "sc_interface_version" },
420 { 0x0302, "callback_num_pres_ind" },
421 { 0x0303, "callback_num_atag" },
422 { 0x0304, "number_of_messages" },
423 { 0x0381, "callback_num" },
424 { 0x0420, "dpf_result" },
425 { 0x0421, "set_dpf" },
426 { 0x0422, "ms_availability_status" },
427 { 0x0423, "network_error_code" },
428 { 0x0424, "message_payload" },
429 { 0x0425, "delivery_failure_reason" },
430 { 0x0426, "more_messages_to_send" },
431 { 0x0427, "message_state" },
432 { 0x0428, "congestion_state" },
433 { 0x0501, "ussd_service_op" },
434 { 0x0600, "broadcast_channel_indicator" },
435 { 0x0601, "broadcast_content_type" },
436 { 0x0602, "broadcast_content_type_info" },
437 { 0x0603, "broadcast_message_class" },
438 { 0x0604, "broadcast_rep_num" },
439 { 0x0605, "broadcast_frequency_interval" },
440 { 0x0606, "broadcast_area_identifier" },
441 { 0x0607, "broadcast_error_status" },
442 { 0x0608, "broadcast_area_success" },
443 { 0x0609, "broadcast_end_time" },
444 { 0x060A, "broadcast_service_group" },
445 { 0x060B, "billing_identification" },
446 { 0x060D, "source_network_id" },
447 { 0x060E, "dest_network_id" },
448 { 0x060F, "source_node_id" },
449 { 0x0610, "dest_node_id" },
450 { 0x0611, "dest_addr_np_resolution" },
451 { 0x0612, "dest_addr_np_information" },
452 { 0x0613, "dest_addr_np_country" },
453 { 0x1201, "display_time" },
454 { 0x1203, "sms_signal" },
455 { 0x1204, "ms_validity" },
456 { 0x130C, "alert_on_message_delivery" },
457 { 0x1380, "its_reply_type" },
458 { 0x1383, "its_session_info" },
462 static const value_string vals_addr_ton[] = {
464 { 1, "International" },
466 { 3, "Network specific" },
467 { 4, "Subscriber number" },
468 { 5, "Alphanumeric" },
469 { 6, "Abbreviated" },
473 static const value_string vals_addr_npi[] = {
475 { 1, "ISDN (E163/E164)" },
476 { 3, "Data (X.121)" },
477 { 4, "Telex (F.69)" },
478 { 6, "Land mobile (E.212)" },
482 { 14, "Internet (IP)" },
483 { 18, "WAP client Id" },
487 static const value_string vals_esm_submit_msg_mode[] = {
488 { 0x0, "Default SMSC mode" },
489 { 0x1, "Datagram mode" },
490 { 0x2, "Forward mode" },
491 { 0x3, "Store and forward mode" },
495 static const value_string vals_esm_submit_msg_type[] = {
496 { 0x0, "Default message type" },
497 { 0x1, "Short message contains SMSC Delivery Receipt" },
498 { 0x2, "Short message contains (E)SME delivery acknowledgement" },
500 { 0x4, "Short message contains (E)SME manual/user acknowledgement" },
502 { 0x6, "Short message contains conversation abort" },
504 { 0x8, "Short message contains intermediate delivery notification" },
508 static const value_string vals_esm_submit_features[] = {
509 { 0x0, "No specific features selected" },
510 { 0x1, "UDHI indicator" },
511 { 0x2, "Reply path" },
512 { 0x3, "UDHI and reply path" },
516 static const value_string vals_priority_flag[] = {
517 { 0, "GSM: None ANSI-136: Bulk IS-95: Normal" },
518 { 1, "GSM: priority ANSI-136: Normal IS-95: Interactive" },
519 { 2, "GSM: priority ANSI-136: Urgent IS-95: Urgent" },
520 { 3, "GSM: priority ANSI-136: Very Urgent IS-95: Emergency" },
524 static const value_string vals_regdel_receipt[] = {
525 { 0x0, "No SMSC delivery receipt requested" },
526 { 0x1, "Delivery receipt requested (for success or failure)" },
527 { 0x2, "Delivery receipt requested (for failure)" },
528 { 0x3, "Reserved in version <= 3.4; Delivery receipt requested (for success) in 5.0" },
532 static const value_string vals_regdel_acks[] = {
533 { 0x0, "No recipient SME acknowledgement requested" },
534 { 0x1, "SME delivery acknowledgement requested" },
535 { 0x2, "SME manual/user acknowledgement requested" },
536 { 0x3, "Both delivery and manual/user acknowledgement requested" },
540 static const value_string vals_regdel_notif[] = {
541 { 0x0, "No intermediate notification requested" },
542 { 0x1, "Intermediate notification requested" },
546 static const value_string vals_replace_if_present_flag[] = {
547 { 0x0, "Don't replace" },
552 static const value_string vals_data_coding[] = {
553 { 0, "SMSC default alphabet" },
554 { 1, "IA5 (CCITT T.50/ASCII (ANSI X3.4)" },
555 { 2, "Octet unspecified (8-bit binary)" },
556 { 3, "Latin 1 (ISO-8859-1)" },
557 { 4, "Octet unspecified (8-bit binary)" },
558 { 5, "JIS (X 0208-1990)" },
559 { 6, "Cyrillic (ISO-8859-5)" },
560 { 7, "Latin/Hebrew (ISO-8859-8)" },
561 { 8, "UCS2 (ISO/IEC-10646)" },
562 { 9, "Pictogram encoding" },
563 { 10, "ISO-2022-JP (Music codes)" },
566 { 13, "Extended Kanji JIS(X 0212-1990)" },
568 /*! \TODO Rest to be defined (bitmask?) according GSM 03.38 */
572 static const value_string vals_message_state[] = {
577 { 5, "UNDELIVERABLE" },
584 static const value_string vals_addr_subunit[] = {
585 { 0, "Unknown -default-" },
587 { 2, "Mobile equipment" },
588 { 3, "Smart card 1" },
589 { 4, "External unit 1" },
593 static const value_string vals_network_type[] = {
596 { 2, "ANSI-136/TDMA" },
602 { 8, "Paging network" },
606 static const value_string vals_bearer_type[] = {
609 { 2, "Circuit Switched Data (CSD)" },
610 { 3, "Packet data" },
614 { 7, "FLEX/ReFLEX" },
615 { 8, "Cell Broadcast" },
619 static const value_string vals_payload_type[] = {
621 { 1, "WCMP message" },
625 static const value_string vals_privacy_indicator[] = {
626 { 0, "Not restricted -default-" },
628 { 2, "Confidential" },
633 static const value_string vals_language_indicator[] = {
634 { 0, "Unspecified -default-" },
643 static const value_string vals_display_time[] = {
645 { 1, "Default -default-" },
650 static const value_string vals_ms_validity[] = {
651 { 0, "Store indefinitely -default-" },
653 { 2, "SID based registration area" },
654 { 3, "Display only" },
658 static const value_string vals_dpf_result[] = {
659 { 0, "DPF not set" },
664 static const value_string vals_set_dpf[] = {
665 { 0, "Not requested (Set DPF for delivery failure)" },
666 { 1, "Requested (Set DPF for delivery failure)" },
670 static const value_string vals_ms_availability_status[] = {
671 { 0, "Available -default-" },
673 { 2, "Unavailable" },
677 static const value_string vals_delivery_failure_reason[] = {
678 { 0, "Destination unavailable" },
679 { 1, "Destination address invalid" },
680 { 2, "Permanent network error" },
681 { 3, "Temporary network error" },
685 static const value_string vals_more_messages_to_send[] = {
686 { 0, "No more messages" },
687 { 1, "More messages -default-" },
691 static const value_string vals_its_reply_type[] = {
694 { 2, "Telephone no." },
696 { 4, "Character line" },
704 static const value_string vals_ussd_service_op[] = {
705 { 0, "PSSD indication" },
706 { 1, "PSSR indication" },
707 { 2, "USSR request" },
708 { 3, "USSN request" },
709 { 16, "PSSD response" },
710 { 17, "PSSR response" },
711 { 18, "USSR confirm" },
712 { 19, "USSN confirm" },
716 static const value_string vals_msg_wait_ind[] = {
717 { 0, "Set indication inactive" },
718 { 1, "Set indication active" },
722 static const value_string vals_msg_wait_type[] = {
723 { 0, "Voicemail message waiting" },
724 { 1, "Fax message waiting" },
725 { 2, "Electronic mail message waiting" },
726 { 3, "Other message waiting" },
730 static const value_string vals_callback_num_pres[] = {
731 { 0, "Presentation allowed" },
732 { 1, "Presentation restricted" },
733 { 2, "Number not available" },
738 static const value_string vals_callback_num_scrn[] = {
739 { 0, "User provided, not screened" },
740 { 1, "User provided, verified and passed" },
741 { 2, "User provided, verified and failed" },
742 { 3, "Network provided" },
746 static const value_string vals_network_error_type[] = {
747 { 1, "ANSI-136 (Access Denied Reason)" },
748 { 2, "IS-95 (Access Denied Reason)" },
750 { 4, "[Reserved] in <= 3.4; ANSI 136 Cause Code in 5.0" },
751 { 5, "[Reserved] in <= 3.4; IS 95 Cause Code in 5.0" },
752 { 6, "[Reserved] in <= 3.4; ANSI-41 Error in 5.0" },
753 { 7, "[Reserved] in <= 3.4; SMPP Error in 5.0" },
754 { 8, "[Reserved] in <= 3.4; Message Center Specific in 5.0" },
758 static const value_string vals_its_session_ind[] = {
759 { 0, "End of session indicator inactive" },
760 { 1, "End of session indicator active" },
764 /* Data Coding Scheme: see 3GPP TS 23.040 and 3GPP TS 23.038 */
765 static const value_string vals_dcs_sms_coding_group[] = {
766 { 0x00, "SMS DCS: General Data Coding indication - Uncompressed text, no message class" },
767 { 0x01, "SMS DCS: General Data Coding indication - Uncompressed text" },
768 { 0x02, "SMS DCS: General Data Coding indication - Compressed text, no message class" },
769 { 0x03, "SMS DCS: General Data Coding indication - Compressed text" },
770 { 0x04, "SMS DCS: Message Marked for Automatic Deletion - Uncompressed text, no message class" },
771 { 0x05, "SMS DCS: Message Marked for Automatic Deletion - Uncompressed text" },
772 { 0x06, "SMS DCS: Message Marked for Automatic Deletion - Compressed text, no message class" },
773 { 0x07, "SMS DCS: Message Marked for Automatic Deletion - Compressed text" },
774 { 0x08, "SMS DCS: Reserved" },
775 { 0x09, "SMS DCS: Reserved" },
776 { 0x0A, "SMS DCS: Reserved" },
777 { 0x0B, "SMS DCS: Reserved" },
778 { 0x0C, "SMS DCS: Message Waiting Indication - Discard Message" },
779 { 0x0D, "SMS DCS: Message Waiting Indication - Store Message (GSM 7-bit default alphabet)" },
780 { 0x0E, "SMS DCS: Message Waiting Indication - Store Message (UCS-2 character set)" },
781 { 0x0F, "SMS DCS: Data coding / message class" },
785 static const true_false_string tfs_dcs_text_compression = {
790 static const true_false_string tfs_dcs_class_present = {
791 "Message class is present",
795 static const value_string vals_dcs_charset[] = {
796 { 0x00, "GSM 7-bit default alphabet" },
797 { 0x01, "8-bit data" },
798 { 0x02, "UCS-2 (16-bit) data" },
799 { 0x03, "Reserved" },
803 static const value_string vals_dcs_class[] = {
805 { 0x01, "Class 1 - ME specific" },
806 { 0x02, "Class 2 - (U)SIM specific" },
807 { 0x03, "Class 3 - TE specific" },
811 static const value_string vals_dcs_cbs_coding_group[] = {
812 { 0x00, "CBS DCS: Language using the GSM 7-bit default alphabet" },
813 { 0x01, "CBS DCS: Language indication at beginning of message" },
814 { 0x02, "CBS DCS: Language using the GSM 7-bit default alphabet" },
815 { 0x03, "CBS DCS: Reserved" },
816 { 0x04, "CBS DCS: General Data Coding indication - Uncompressed text, no message class" },
817 { 0x05, "CBS DCS: General Data Coding indication - Uncompressed text" },
818 { 0x06, "CBS DCS: General Data Coding indication - Compressed text, no message class" },
819 { 0x07, "CBS DCS: General Data Coding indication - Compressed text" },
820 { 0x08, "CBS DCS: Reserved" },
821 { 0x09, "CBS DCS: Message with User Data Header structure" },
822 { 0x0A, "CBS DCS: Reserved" },
823 { 0x0B, "CBS DCS: Reserved" },
824 { 0x0C, "CBS DCS: Reserved" },
825 { 0x0D, "CBS DCS: Reserved" },
826 { 0x0E, "CBS DCS: Defined by the WAP Forum" },
827 { 0x0F, "SMS DCS: Data coding / message class" },
831 static const value_string vals_dcs_cbs_language[] = {
840 { 0x08, "Portuguese" },
842 { 0x0A, "Norwegian" },
845 { 0x0D, "Hungarian" },
847 { 0x0F, "Language not specified" },
848 { 0x10, "GSM 7-bit default alphabet - message preceded by language indication" },
849 { 0x11, "UCS-2 (16-bit) - message preceded by language indication" },
854 { 0x24, "Icelandic" },
858 static const value_string vals_dcs_cbs_class[] = {
859 { 0x00, "No message class" },
860 { 0x01, "Class 1 - User defined" },
861 { 0x02, "Class 2 - User defined" },
862 { 0x03, "Class 3 - TE specific" },
866 static const value_string vals_dcs_wap_class[] = {
867 { 0x00, "No message class" },
868 { 0x01, "Class 1 - ME specific" },
869 { 0x02, "Class 2 - (U)SIM specific" },
870 { 0x03, "Class 3 - TE specific" },
874 static const value_string vals_dcs_wap_charset[] = {
875 { 0x00, "Reserved" },
876 { 0x01, "8-bit data" },
877 { 0x02, "Reserved" },
878 { 0x03, "Reserved" },
882 static const value_string vals_alert_on_message_delivery[] = {
883 { 0x00, "Use mobile default alert (Default)" },
884 { 0x01, "Use low-priority alert" },
885 { 0x02, "Use medium-priority alert" },
886 { 0x03, "Use high-priority alert" },
890 static const range_string vals_congestion_state[] = {
893 {30, 49, "Medium Load"},
894 {50, 79, "High Load"},
895 {80, 89, "Optimum Load"}, /*Specs says 80-90, but that is probably a mistake */
896 {90, 99, "Nearing Congestion"},
897 {100, 100, "Congested / Maximum Load"},
901 static const range_string vals_broadcast_channel_indicator[] = {
902 {0, 0, "Basic Broadcast Channel (Default)"},
903 {1, 1, "Extended Broadcast Channel"},
904 {2, 255, "[Reserved]"},
908 static const value_string vals_broadcast_message_class[] = {
909 {0, "No Class Specified (default)"},
910 {1, "Class 1 (User Defined)"},
911 {2, "Class 2 (User Defined)"},
912 {3, "Class 3 (Terminal Equipment)"},
916 static const range_string vals_broadcast_area_success[] = {
918 {101, 254, "[Reserved]"},
919 {255, 255, "Information not available"},
923 static const value_string vals_broadcast_content_type_nw[] = {
926 {2, "TDMA [IS824][ANSI-41]"},
927 {3, "CDMA [IS824][IS637]"},
931 static const value_string vals_broadcast_content_type_type[] = {
932 {0x0000, "[System Service] Index"},
933 {0x0001, "[System Service] Emergency Broadcasts"},
934 {0x0002, "[System Service] IRDB Download"},
935 {0x0010, "[News Service] News Flashes"},
936 {0x0011, "[News Service] General News (Local)"},
937 {0x0012, "[News Service] General News (Regional)"},
938 {0x0013, "[News Service] General News (National)"},
939 {0x0014, "[News Service] General News (Internationa)"},
940 {0x0015, "[News Service] Business/Financial News (Local)"},
941 {0x0016, "[News Service] Business/Financial News (Regional)"},
942 {0x0017, "[News Service] Business/Financial News (National)"},
943 {0x0018, "[News Service] Business/Financial News (International)"},
944 {0x0019, "[News Service] Sports News (Local)"},
945 {0x001A, "[News Service] Sports News (Regional)"},
946 {0x001B, "[News Service] Sports News (National)"},
947 {0x001C, "[News Service] Sports News (International)"},
948 {0x001D, "[News Service] Entertainment News (Local)"},
949 {0x001E, "[News Service] Entertainment News (Regional)"},
950 {0x001F, "[News Service] Entertainment News (National)"},
951 {0x0020, "[News Service] Entertainment News (International)"},
952 {0x0021, "[Subscriber Information Services] Medical/Health/Hospitals"},
953 {0x0022, "[Subscriber Information Services] Doctors"},
954 {0x0023, "[Subscriber Information Services] Pharmacy"},
955 {0x0030, "[Subscriber Information Services] Local Traffic/Road Reports"},
956 {0x0031, "[Subscriber Information Services] Long Distance Traffic/Road Reports"},
957 {0x0032, "[Subscriber Information Services] Taxis"},
958 {0x0033, "[Subscriber Information Services] Weather"},
959 {0x0034, "[Subscriber Information Services] Local Airport Flight Schedules"},
960 {0x0035, "[Subscriber Information Services] Restaurants"},
961 {0x0036, "[Subscriber Information Services] Lodgings"},
962 {0x0037, "[Subscriber Information Services] Retail Directory"},
963 {0x0038, "[Subscriber Information Services] Advertisements"},
964 {0x0039, "[Subscriber Information Services] Stock Quotes"},
965 {0x0040, "[Subscriber Information Services] Employment Opportunities"},
966 {0x0041, "[Subscriber Information Services] Technology News"},
967 {0x0070, "[Carrier Information Services] District (Base Station Info)"},
968 {0x0071, "[Carrier Information Services] Network Information"},
969 {0x0080, "[Subscriber Care Services] Operator Services"},
970 {0x0081, "[Subscriber Care Services] Directory Enquiries (National)"},
971 {0x0082, "[Subscriber Care Services] Directory Enquiries (International)"},
972 {0x0083, "[Subscriber Care Services] Customer Care (National)"},
973 {0x0084, "[Subscriber Care Services] Customer Care (International)"},
974 {0x0085, "[Subscriber Care Services] Local Date/Time/Time Zone"},
975 {0x0100, "[Multi Category Services] Multi Category Services"},
979 static const value_string vals_broadcast_frequency_interval_unit[] = {
980 {0x00, "As frequently as possible"},
991 static const value_string vals_dest_addr_np_resolution[] = {
992 {0x00, "query has not been performed (default)"},
993 {0x01, "query has been performed, number not ported"},
994 {0x02, "query has been performed, number ported"},
998 static const range_string vals_broadcast_area_identifier_format[] = {
999 {0, 0, "Alias / Name"},
1000 {1, 1, "Ellipsoid Arc"},
1002 {3, 255, "[Reserved]"},
1006 static dissector_handle_t gsm_sms_handle;
1012 smpp_stats_tree_init(stats_tree* st)
1014 st_smpp_ops = stats_tree_create_node(st, "SMPP Operations", 0, TRUE);
1015 st_smpp_req = stats_tree_create_node(st, "SMPP Requests", st_smpp_ops, TRUE);
1016 st_smpp_res = stats_tree_create_node(st, "SMPP Responses", st_smpp_ops, TRUE);
1017 st_smpp_res_status = stats_tree_create_node(st, "SMPP Response Status", 0, TRUE);
1022 smpp_stats_tree_per_packet(stats_tree *st, /* st as it was passed to us */
1023 packet_info *pinfo _U_,
1024 epan_dissect_t *edt _U_,
1025 const void *p) /* Used for getting SMPP command_id values */
1027 smpp_tap_rec_t* tap_rec = (smpp_tap_rec_t*)p;
1029 tick_stat_node(st, "SMPP Operations", 0, TRUE);
1031 if ((tap_rec->command_id & 0x80000000) == 0x80000000) /* Response */
1033 tick_stat_node(st, "SMPP Responses", st_smpp_ops, TRUE);
1034 tick_stat_node(st, val_to_str(tap_rec->command_id, vals_command_id, "Unknown 0x%08x"), st_smpp_res, FALSE);
1036 tick_stat_node(st, "SMPP Response Status", 0, TRUE);
1037 tick_stat_node(st, val_to_str(tap_rec->command_status, vals_command_status, "Unknown 0x%08x"), st_smpp_res_status, FALSE);
1042 tick_stat_node(st, "SMPP Requests", st_smpp_ops, TRUE);
1043 tick_stat_node(st, val_to_str(tap_rec->command_id, vals_command_id, "Unknown 0x%08x"), st_smpp_req, FALSE);
1050 * SMPP equivalent of mktime() (3). Convert date to standard 'time_t' format
1052 * \param datestr The SMPP-formatted date to convert
1053 * \param secs Returns the 'time_t' equivalent
1054 * \param nsecs Returns the additional nano-seconds
1056 * \return Whether time is specified relative or absolute
1057 * \retval TRUE Relative time
1058 * \retval FALSE Absolute time
1061 smpp_mktime(const char *datestr, time_t *secs, int *nsecs)
1065 gboolean relative = (datestr[15] == 'R') ? TRUE : FALSE;
1067 r_time.tm_year = 10 * (datestr[0] - '0') + (datestr[1] - '0');
1069 * Y2K rollover date as recommended in appendix C
1071 if (r_time.tm_year < 38)
1072 r_time.tm_year += 100;
1073 r_time.tm_mon = 10 * (datestr[2] - '0') + (datestr[3] - '0');
1075 r_time.tm_mday = 10 * (datestr[4] - '0') + (datestr[5] - '0');
1076 r_time.tm_hour = 10 * (datestr[6] - '0') + (datestr[7] - '0');
1077 r_time.tm_min = 10 * (datestr[8] - '0') + (datestr[9] - '0');
1078 r_time.tm_sec = 10 * (datestr[10] - '0') + (datestr[11] - '0');
1079 r_time.tm_isdst = -1;
1081 if (relative == FALSE) {
1082 *secs = mktime(&r_time);
1083 *nsecs = (datestr[12] - '0') * 100000000;
1084 t_diff = (10 * (datestr[13] - '0') + (datestr[14] - '0')) * 900;
1085 if (datestr[15] == '+')
1087 else if (datestr[15] == '-')
1090 *secs = r_time.tm_sec + 60 *
1091 (r_time.tm_min + 60 *
1092 (r_time.tm_hour + 24 *
1101 * Scanning routines to add standard types (byte, int, string...) to the
1104 * \param tree The protocol tree to add to
1105 * \param tvb Buffer containing the data
1106 * \param field Actual field whose value needs displaying
1107 * \param offset Location of field in buffer, returns location of
1111 smpp_handle_string(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
1115 len = tvb_strsize(tvb, *offset);
1117 proto_tree_add_string(tree, field, tvb, *offset, len,
1118 (const char *) tvb_get_ptr(tvb, *offset, len));
1123 /* NOTE - caller must free the returned string! */
1125 smpp_handle_string_return(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
1130 len = tvb_strsize(tvb, *offset);
1132 str = (char *)tvb_get_ephemeral_stringz(tvb, *offset, &len);
1133 proto_tree_add_string(tree, field, tvb, *offset, len, str);
1142 smpp_handle_string_z(proto_tree *tree, tvbuff_t *tvb, int field, int *offset,
1143 const char *null_string)
1147 len = tvb_strsize(tvb, *offset);
1149 proto_tree_add_string(tree, field, tvb, *offset, len,
1150 (const char *)tvb_get_ptr(tvb, *offset, len));
1152 proto_tree_add_string(tree, field, tvb, *offset, len, null_string);
1158 smpp_handle_int1(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
1162 val = tvb_get_guint8(tvb, *offset);
1163 proto_tree_add_uint(tree, field, tvb, *offset, 1, val);
1168 smpp_handle_int2(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
1172 val = tvb_get_ntohs(tvb, *offset);
1173 proto_tree_add_uint(tree, field, tvb, *offset, 2, val);
1178 smpp_handle_int4(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
1182 val = tvb_get_ntohl(tvb, *offset);
1183 proto_tree_add_uint(tree, field, tvb, *offset, 4, val);
1188 smpp_handle_time(proto_tree *tree, tvbuff_t *tvb,
1189 int field, int field_R, int *offset)
1195 strval = (char *) tvb_get_ephemeral_stringz(tvb, *offset, &len);
1200 if (smpp_mktime(strval, &tmptime.secs, &tmptime.nsecs))
1201 proto_tree_add_time(tree, field_R, tvb, *offset, len, &tmptime);
1203 proto_tree_add_time(tree, field, tvb, *offset, len, &tmptime);
1207 proto_tree_add_text(tree, tvb, *offset, len, "Invalid time: %s", strval);
1214 * Scanning routine to handle the destination-list of 'submit_multi'
1216 * \param tree The protocol tree to add to
1217 * \param tvb Buffer containing the data
1218 * \param offset Location of field in buffer, returns location of
1222 smpp_handle_dlist(proto_tree *tree, tvbuff_t *tvb, int *offset)
1225 int tmpoff = *offset;
1226 proto_item *sub_tree = NULL;
1229 if ((entries = tvb_get_guint8(tvb, tmpoff++)))
1231 sub_tree = proto_tree_add_item(tree, hf_smpp_dlist,
1232 tvb, *offset, 1, FALSE);
1233 proto_item_add_subtree(sub_tree, ett_dlist);
1237 dest_flag = tvb_get_guint8(tvb, tmpoff++);
1238 if (dest_flag == 1) /* SME address */
1240 smpp_handle_int1(sub_tree, tvb, hf_smpp_dest_addr_ton, &tmpoff);
1241 smpp_handle_int1(sub_tree, tvb, hf_smpp_dest_addr_npi, &tmpoff);
1242 smpp_handle_string(sub_tree,tvb,hf_smpp_destination_addr,&tmpoff);
1244 else /* Distribution list */
1246 smpp_handle_string(sub_tree, tvb, hf_smpp_dl_name, &tmpoff);
1253 * Scanning routine to handle the destination result list
1254 * of 'submit_multi_resp'
1256 * \param tree The protocol tree to add to
1257 * \param tvb Buffer containing the data
1258 * \param offset Location of field in buffer, returns location of
1262 smpp_handle_dlist_resp(proto_tree *tree, tvbuff_t *tvb, int *offset)
1265 int tmpoff = *offset;
1266 proto_item *sub_tree = NULL;
1268 if ((entries = tvb_get_guint8(tvb, tmpoff++)))
1270 sub_tree = proto_tree_add_item(tree, hf_smpp_dlist_resp,
1271 tvb, *offset, 1, FALSE);
1272 proto_item_add_subtree(sub_tree, ett_dlist_resp);
1276 smpp_handle_int1(sub_tree, tvb, hf_smpp_dest_addr_ton, &tmpoff);
1277 smpp_handle_int1(sub_tree, tvb, hf_smpp_dest_addr_npi, &tmpoff);
1278 smpp_handle_string(sub_tree,tvb,hf_smpp_destination_addr,&tmpoff);
1279 smpp_handle_int4(sub_tree, tvb, hf_smpp_error_status_code, &tmpoff);
1285 * Scanning routine to handle all optional parameters of SMPP-operations.
1286 * The parameters have the format Tag Length Value (TLV), with a 2-byte tag
1287 * and 2-byte length.
1289 * \param tree The protocol tree to add to
1290 * \param tvb Buffer containing the data
1291 * \param offset Location of field in buffer, returns location of
1295 smpp_handle_tlv(proto_tree *tree, tvbuff_t *tvb, int *offset)
1297 proto_item *tlvs_tree = NULL;
1299 if (tvb_reported_length_remaining(tvb, *offset) >= 1)
1301 tlvs_tree = proto_tree_add_item(tree, hf_smpp_opt_params,
1302 tvb, *offset, -1, FALSE);
1303 proto_item_add_subtree(tlvs_tree, ett_opt_params);
1306 while (tvb_reported_length_remaining(tvb, *offset) >= 1)
1308 proto_item *sub_tree;
1314 guint8 major, minor;
1317 tag = tvb_get_ntohs(tvb, *offset);
1318 length = tvb_get_ntohs(tvb, (*offset+2));
1320 sub_tree = proto_tree_add_none_format(tlvs_tree, hf_smpp_opt_param,
1321 tvb, *offset, length+4,
1322 "Optional parameter: %s (0x%04x)",
1323 val_to_str(tag, vals_tlv_tags, "0x%04x"), tag);
1324 proto_item_add_subtree(sub_tree, ett_opt_param);
1325 proto_tree_add_uint(sub_tree,hf_smpp_opt_param_tag,tvb,*offset,2,tag);
1326 proto_tree_add_uint(sub_tree,hf_smpp_opt_param_len,tvb,*offset+2,2,length);
1331 case 0x0005: /* dest_addr_subunit */
1332 smpp_handle_int1(sub_tree, tvb,
1333 hf_smpp_dest_addr_subunit, offset);
1335 case 0x0006: /* dest_network_type */
1336 smpp_handle_int1(sub_tree, tvb,
1337 hf_smpp_dest_network_type, offset);
1339 case 0x0007: /* dest_bearer_type */
1340 smpp_handle_int1(sub_tree, tvb,
1341 hf_smpp_dest_bearer_type, offset);
1343 case 0x0008: /* dest_telematics_id */
1344 smpp_handle_int2(sub_tree, tvb,
1345 hf_smpp_dest_telematics_id, offset);
1347 case 0x000D: /* source_addr_subunit */
1348 smpp_handle_int1(sub_tree, tvb,
1349 hf_smpp_source_addr_subunit, offset);
1351 case 0x000E: /* source_network_type */
1352 smpp_handle_int1(sub_tree, tvb,
1353 hf_smpp_source_network_type, offset);
1355 case 0x000F: /* source_bearer_type */
1356 smpp_handle_int1(sub_tree, tvb,
1357 hf_smpp_source_bearer_type, offset);
1359 case 0x0010: /* source_telematics_id */
1360 smpp_handle_int2(sub_tree, tvb,
1361 hf_smpp_source_telematics_id, offset);
1363 case 0x0017: /* qos_time_to_live */
1364 smpp_handle_int4(sub_tree, tvb,
1365 hf_smpp_qos_time_to_live, offset);
1367 case 0x0019: /* payload_type */
1368 smpp_handle_int1(sub_tree, tvb,
1369 hf_smpp_payload_type, offset);
1371 case 0x001D: /* additional_status_info_text */
1372 smpp_handle_string(sub_tree, tvb,
1373 hf_smpp_additional_status_info_text, offset);
1375 case 0x001E: /* receipted_message_id */
1376 smpp_handle_string(sub_tree, tvb,
1377 hf_smpp_receipted_message_id, offset);
1379 case 0x0030: /* ms_msg_wait_facilities */
1380 field = tvb_get_guint8(tvb, *offset);
1381 proto_tree_add_item(sub_tree, hf_smpp_msg_wait_ind,
1382 tvb, *offset, 1, field);
1383 proto_tree_add_item(sub_tree, hf_smpp_msg_wait_type,
1384 tvb, *offset, 1, field);
1387 case 0x0201: /* privacy_indicator */
1388 smpp_handle_int1(sub_tree, tvb,
1389 hf_smpp_privacy_indicator, offset);
1391 case 0x0202: /* source_subaddress */
1393 proto_tree_add_item(sub_tree, hf_smpp_source_subaddress,
1394 tvb, *offset, length, FALSE);
1395 (*offset) += length;
1398 case 0x0203: /* dest_subaddress */
1400 proto_tree_add_item(sub_tree, hf_smpp_dest_subaddress,
1401 tvb, *offset, length, FALSE);
1402 (*offset) += length;
1405 case 0x0204: /* user_message_reference */
1406 smpp_handle_int2(sub_tree, tvb,
1407 hf_smpp_user_message_reference, offset);
1409 case 0x0205: /* user_response_code */
1410 smpp_handle_int1(sub_tree, tvb,
1411 hf_smpp_user_response_code, offset);
1413 case 0x020A: /* source_port */
1414 smpp_handle_int2(sub_tree, tvb,
1415 hf_smpp_source_port, offset);
1417 case 0x020B: /* destination_port */
1418 smpp_handle_int2(sub_tree, tvb,
1419 hf_smpp_destination_port, offset);
1421 case 0x020C: /* sar_msg_ref_num */
1422 smpp_handle_int2(sub_tree, tvb,
1423 hf_smpp_sar_msg_ref_num, offset);
1425 case 0x020D: /* language_indicator */
1426 smpp_handle_int1(sub_tree, tvb,
1427 hf_smpp_language_indicator, offset);
1429 case 0x020E: /* sar_total_segments */
1430 smpp_handle_int1(sub_tree, tvb,
1431 hf_smpp_sar_total_segments, offset);
1433 case 0x020F: /* sar_segment_seqnum */
1434 smpp_handle_int1(sub_tree, tvb,
1435 hf_smpp_sar_segment_seqnum, offset);
1437 case 0x0210: /* SC_interface_version */
1438 field = tvb_get_guint8(tvb, *offset);
1439 minor = field & 0x0F;
1440 major = (field & 0xF0) >> 4;
1441 strval=ep_alloc(BUFSIZ);
1442 g_snprintf(strval, BUFSIZ, "%u.%u", major, minor);
1443 proto_tree_add_string(sub_tree, hf_smpp_SC_interface_version,
1444 tvb, *offset, 1, strval);
1447 case 0x0302: /* callback_num_pres_ind */
1448 field = tvb_get_guint8(tvb, *offset);
1449 proto_tree_add_item(sub_tree, hf_smpp_callback_num_pres,
1450 tvb, *offset, 1, field);
1451 proto_tree_add_item(sub_tree, hf_smpp_callback_num_scrn,
1452 tvb, *offset, 1, field);
1455 case 0x0303: /* callback_num_atag */
1457 proto_tree_add_item(sub_tree, hf_smpp_callback_num_atag,
1458 tvb, *offset, length, FALSE);
1459 (*offset) += length;
1461 case 0x0304: /* number_of_messages */
1462 smpp_handle_int1(sub_tree, tvb,
1463 hf_smpp_number_of_messages, offset);
1465 case 0x0381: /* callback_num */
1467 proto_tree_add_item(sub_tree, hf_smpp_callback_num,
1468 tvb, *offset, length, FALSE);
1469 (*offset) += length;
1471 case 0x0420: /* dpf_result */
1472 smpp_handle_int1(sub_tree, tvb,
1473 hf_smpp_dpf_result, offset);
1475 case 0x0421: /* set_dpf */
1476 smpp_handle_int1(sub_tree, tvb,
1477 hf_smpp_set_dpf, offset);
1479 case 0x0422: /* ms_availability_status */
1480 smpp_handle_int1(sub_tree, tvb,
1481 hf_smpp_ms_availability_status, offset);
1483 case 0x0423: /* network_error_code */
1484 smpp_handle_int1(sub_tree, tvb,
1485 hf_smpp_network_error_type, offset);
1486 smpp_handle_int2(sub_tree, tvb,
1487 hf_smpp_network_error_code, offset);
1489 case 0x0424: /* message_payload */
1491 proto_tree_add_item(sub_tree, hf_smpp_message_payload,
1492 tvb, *offset, length, FALSE);
1493 (*offset) += length;
1495 case 0x0425: /* delivery_failure_reason */
1496 smpp_handle_int1(sub_tree, tvb,
1497 hf_smpp_delivery_failure_reason, offset);
1499 case 0x0426: /* more_messages_to_send */
1500 smpp_handle_int1(sub_tree, tvb,
1501 hf_smpp_more_messages_to_send, offset);
1503 case 0x0427: /* message_state */
1504 smpp_handle_int1(sub_tree, tvb,
1505 hf_smpp_message_state, offset);
1507 case 0x0428: /* congestion_state */
1508 smpp_handle_int1(sub_tree, tvb,
1509 hf_smpp_congestion_state, offset);
1512 case 0x0501: /* ussd_service_op */
1513 smpp_handle_int1(sub_tree, tvb,
1514 hf_smpp_ussd_service_op, offset);
1516 case 0x0600: /* broadcast_channel_indicator */
1517 smpp_handle_int1(sub_tree, tvb,
1518 hf_smpp_broadcast_channel_indicator, offset);
1520 case 0x0601: /* broadcast_content_type */
1521 field = tvb_get_guint8(tvb, *offset);
1522 proto_tree_add_uint(sub_tree, hf_smpp_broadcast_content_type_nw, tvb, *offset, 1, field);
1524 field16 = tvb_get_ntohs(tvb, *offset);
1525 proto_tree_add_uint(sub_tree, hf_smpp_broadcast_content_type_type, tvb, *offset, 2, field16);
1528 case 0x0602: /* broadcast_content_type_info */
1530 proto_tree_add_item(sub_tree, hf_smpp_broadcast_content_type_info,
1531 tvb, *offset, length, FALSE);
1532 (*offset) += length;
1534 case 0x0603: /* broadcast_message_class */
1535 smpp_handle_int1(sub_tree, tvb,
1536 hf_smpp_broadcast_message_class, offset);
1538 case 0x0604: /* broadcast_rep_num */
1539 smpp_handle_int1(sub_tree, tvb,
1540 hf_smpp_broadcast_rep_num, offset);
1542 case 0x0605: /* broadcast_frequency_interval */
1543 field = tvb_get_guint8(tvb, *offset);
1544 proto_tree_add_uint(sub_tree, hf_smpp_broadcast_frequency_interval_unit, tvb, *offset, 1, field);
1546 field16 = tvb_get_ntohs(tvb, *offset);
1547 proto_tree_add_uint(sub_tree, hf_smpp_broadcast_frequency_interval_value, tvb, *offset, 2, field16);
1550 case 0x0606: /* broadcast_area_identifier */
1551 field = tvb_get_guint8(tvb, *offset);
1552 proto_tree_add_uint(sub_tree, hf_smpp_broadcast_area_identifier_format, tvb, *offset, 1, field);
1553 proto_tree_add_item(sub_tree, hf_smpp_broadcast_area_identifier,
1554 tvb, *offset, length, FALSE);
1555 (*offset) += length;
1557 case 0x0607: /* broadcast_error_status */
1558 smpp_handle_int4(sub_tree, tvb,
1559 hf_smpp_broadcast_error_status, offset);
1561 case 0x0608: /* broadcast_area_success */
1562 smpp_handle_int1(sub_tree, tvb,
1563 hf_smpp_broadcast_area_success, offset);
1565 case 0x0609: /* broadcast_end_time */
1566 smpp_handle_time(sub_tree, tvb, hf_smpp_broadcast_end_time,
1567 hf_smpp_broadcast_end_time_r, offset);
1569 case 0x060A: /* broadcast_service_group */
1571 proto_tree_add_item(sub_tree, hf_smpp_broadcast_service_group,
1572 tvb, *offset, length, FALSE);
1573 (*offset) += length;
1575 case 0x060B: /* billing_identification */
1577 proto_tree_add_item(sub_tree, hf_smpp_billing_identification,
1578 tvb, *offset, length, FALSE);
1579 (*offset) += length;
1581 /* 0x060C is skipped in the specs for some reason :-? */
1582 case 0x060D: /* source_network_id */
1583 smpp_handle_string_z(sub_tree, tvb, hf_smpp_source_network_id,
1586 case 0x060E: /* dest_network_id */
1587 smpp_handle_string_z(sub_tree, tvb, hf_smpp_dest_network_id,
1590 case 0x060F: /* source_node_id */
1592 proto_tree_add_item(sub_tree, hf_smpp_source_node_id,
1593 tvb, *offset, length, FALSE);
1594 (*offset) += length;
1596 case 0x0610: /* dest_node_id */
1598 proto_tree_add_item(sub_tree, hf_smpp_dest_node_id,
1599 tvb, *offset, length, FALSE);
1600 (*offset) += length;
1602 case 0x0611: /* dest_addr_np_resolution */
1603 smpp_handle_int1(sub_tree, tvb,
1604 hf_smpp_dest_addr_np_resolution, offset);
1606 case 0x0612: /* dest_addr_np_information */
1608 proto_tree_add_item(sub_tree, hf_smpp_dest_addr_np_information,
1609 tvb, *offset, length, FALSE);
1610 (*offset) += length;
1612 case 0x0613: /* dest_addr_np_country */
1613 /* TODO : Fetch values from packet-e164? */
1615 proto_tree_add_item(sub_tree, hf_smpp_dest_addr_np_country,
1616 tvb, *offset, length, FALSE);
1617 (*offset) += length;
1619 case 0x1201: /* display_time */
1620 smpp_handle_int1(sub_tree, tvb,
1621 hf_smpp_display_time, offset);
1623 case 0x1203: /* sms_signal */
1624 smpp_handle_int2(sub_tree, tvb,
1625 hf_smpp_sms_signal, offset);
1626 /*! \todo Fill as per TIA/EIA-136-710-A */
1628 case 0x1204: /* ms_validity */
1629 smpp_handle_int1(sub_tree, tvb,
1630 hf_smpp_ms_validity, offset);
1632 case 0x130C: /* alert_on_message_delivery */
1634 proto_tree_add_item(sub_tree,
1635 hf_smpp_alert_on_message_delivery_null,
1636 tvb, *offset, length, FALSE);
1638 smpp_handle_int1(sub_tree, tvb,
1639 hf_smpp_alert_on_message_delivery, offset);
1642 case 0x1380: /* its_reply_type */
1643 smpp_handle_int1(sub_tree, tvb,
1644 hf_smpp_its_reply_type, offset);
1646 case 0x1383: /* its_session_info */
1647 smpp_handle_int1(sub_tree, tvb,
1648 hf_smpp_its_session_number, offset);
1649 field = tvb_get_guint8(tvb, *offset);
1650 proto_tree_add_item(sub_tree, hf_smpp_its_session_sequence,
1651 tvb, *offset, 1, field);
1652 proto_tree_add_item(sub_tree, hf_smpp_its_session_ind,
1653 tvb, *offset, 1, field);
1658 /* TODO : Hopefully to be implemented soon - handle vendor specific TLVs
1659 * from a dictionary before treating them as unknown! */
1660 if ((tag >= 0x1400) && (tag <= 0x3FFF)) {
1661 proto_tree_add_item(sub_tree, hf_smpp_vendor_op, tvb,
1662 *offset, length, FALSE);
1664 proto_tree_add_item(sub_tree, hf_smpp_reserved_op, tvb,
1665 *offset, length, FALSE);
1668 proto_item_append_text(sub_tree,": %s", tvb_bytes_to_str(tvb,*offset,length));
1669 (*offset) += length;
1676 smpp_handle_dcs(proto_tree *tree, tvbuff_t *tvb, int *offset)
1680 proto_item *subtree = NULL;
1682 val = tvb_get_guint8(tvb, off);
1683 subtree = proto_tree_add_uint(tree,
1684 hf_smpp_data_coding, tvb, off, 1, val);
1685 proto_item_add_subtree(subtree, ett_dcs);
1686 /* SMPP Data Coding Scheme */
1687 proto_tree_add_uint(subtree, hf_smpp_dcs, tvb, off, 1, val);
1688 /* GSM SMS Data Coding Scheme */
1689 proto_tree_add_text(subtree, tvb, off, 1,
1690 "GSM SMS Data Coding");
1691 proto_tree_add_uint(subtree,
1692 hf_smpp_dcs_sms_coding_group, tvb, off, 1, val);
1693 if (val>>6 == 2) { /* Reserved */
1695 } else if (val < 0xF0) {
1696 proto_tree_add_boolean(subtree,
1697 hf_smpp_dcs_text_compression, tvb, off, 1, val);
1698 proto_tree_add_boolean(subtree,
1699 hf_smpp_dcs_class_present, tvb, off, 1, val);
1700 proto_tree_add_uint(subtree,
1701 hf_smpp_dcs_charset, tvb, off, 1, val);
1703 proto_tree_add_uint(subtree,
1704 hf_smpp_dcs_class, tvb, off, 1, val);
1707 proto_tree_add_text(subtree, tvb, off, 1,
1708 "SMPP: Bit .... 1... should be 0 (reserved)");
1709 proto_tree_add_uint(subtree,
1710 hf_smpp_dcs_charset, tvb, off, 1, val);
1711 proto_tree_add_uint(subtree,
1712 hf_smpp_dcs_class, tvb, off, 1, val);
1714 /* Cell Broadcast Service (CBS) Data Coding Scheme */
1715 proto_tree_add_text(subtree, tvb, off, 1,
1716 "GSM CBS Data Coding");
1717 proto_tree_add_uint(subtree,
1718 hf_smpp_dcs_cbs_coding_group, tvb, off, 1, val);
1719 if (val < 0x40) { /* Language specified */
1720 proto_tree_add_uint(subtree,
1721 hf_smpp_dcs_cbs_language, tvb, off, 1, val);
1722 } else if (val>>6 == 1) { /* General Data Coding indication */
1723 proto_tree_add_boolean(subtree,
1724 hf_smpp_dcs_text_compression, tvb, off, 1, val);
1725 proto_tree_add_boolean(subtree,
1726 hf_smpp_dcs_class_present, tvb, off, 1, val);
1727 proto_tree_add_uint(subtree,
1728 hf_smpp_dcs_charset, tvb, off, 1, val);
1730 proto_tree_add_uint(subtree,
1731 hf_smpp_dcs_class, tvb, off, 1, val);
1732 } else if (val>>6 == 2) { /* Message with UDH structure */
1733 proto_tree_add_uint(subtree,
1734 hf_smpp_dcs_charset, tvb, off, 1, val);
1735 proto_tree_add_uint(subtree,
1736 hf_smpp_dcs_class, tvb, off, 1, val);
1737 } else if (val>>4 == 14) { /* WAP Forum */
1738 proto_tree_add_uint(subtree,
1739 hf_smpp_dcs_wap_charset, tvb, off, 1, val);
1740 proto_tree_add_uint(subtree,
1741 hf_smpp_dcs_wap_class, tvb, off, 1, val);
1742 } else if (val>>4 == 15) { /* Data coding / message handling */
1744 proto_tree_add_text(subtree, tvb, off, 1,
1745 "SMPP: Bit .... 1... should be 0 (reserved)");
1746 proto_tree_add_uint(subtree,
1747 hf_smpp_dcs_charset, tvb, off, 1, val);
1748 proto_tree_add_uint(subtree,
1749 hf_smpp_dcs_cbs_class, tvb, off, 1, val);
1756 * The next set of routines handle the different operations, associated
1760 bind_receiver(proto_tree *tree, tvbuff_t *tvb)
1764 guint8 major, minor;
1767 strval=ep_alloc(BUFSIZ);
1768 smpp_handle_string(tree, tvb, hf_smpp_system_id, &offset);
1769 smpp_handle_string(tree, tvb, hf_smpp_password, &offset);
1770 smpp_handle_string(tree, tvb, hf_smpp_system_type, &offset);
1771 field = tvb_get_guint8(tvb, offset++);
1772 minor = field & 0x0F;
1773 major = (field & 0xF0) >> 4;
1774 g_snprintf(strval, BUFSIZ, "%u.%u", major, minor);
1775 proto_tree_add_string(tree, hf_smpp_interface_version, tvb,
1776 offset - 1, 1, strval);
1777 smpp_handle_int1(tree, tvb, hf_smpp_addr_ton, &offset);
1778 smpp_handle_int1(tree, tvb, hf_smpp_addr_npi, &offset);
1779 smpp_handle_string(tree, tvb, hf_smpp_address_range, &offset);
1782 #define bind_transmitter(a, b) bind_receiver(a, b)
1785 query_sm(proto_tree *tree, tvbuff_t *tvb)
1789 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
1790 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_ton, &offset);
1791 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_npi, &offset);
1792 smpp_handle_string(tree, tvb, hf_smpp_source_addr, &offset);
1795 #define bind_transceiver(a, b) bind_receiver(a, b)
1798 outbind(proto_tree *tree, tvbuff_t *tvb)
1802 smpp_handle_string(tree, tvb, hf_smpp_system_id, &offset);
1803 smpp_handle_string(tree, tvb, hf_smpp_password, &offset);
1807 submit_sm(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
1808 proto_tree *top_tree)
1814 char *src_str = NULL;
1815 char *dst_str = NULL;
1816 address save_src, save_dst;
1818 smpp_handle_string_z(tree, tvb, hf_smpp_service_type, &offset, "(Default)");
1819 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_ton, &offset);
1820 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_npi, &offset);
1821 src_str = smpp_handle_string_return(tree, tvb, hf_smpp_source_addr, &offset);
1822 smpp_handle_int1(tree, tvb, hf_smpp_dest_addr_ton, &offset);
1823 smpp_handle_int1(tree, tvb, hf_smpp_dest_addr_npi, &offset);
1824 dst_str = smpp_handle_string_return(tree, tvb, hf_smpp_destination_addr, &offset);
1825 flag = tvb_get_guint8(tvb, offset);
1827 proto_tree_add_item(tree, hf_smpp_esm_submit_msg_mode,
1828 tvb, offset, 1, flag);
1829 proto_tree_add_item(tree, hf_smpp_esm_submit_msg_type,
1830 tvb, offset, 1, flag);
1831 proto_tree_add_item(tree, hf_smpp_esm_submit_features,
1832 tvb, offset, 1, flag);
1834 smpp_handle_int1(tree, tvb, hf_smpp_protocol_id, &offset);
1835 smpp_handle_int1(tree, tvb, hf_smpp_priority_flag, &offset);
1836 if (tvb_get_guint8(tvb,offset)) {
1837 smpp_handle_time(tree, tvb, hf_smpp_schedule_delivery_time,
1838 hf_smpp_schedule_delivery_time_r, &offset);
1839 } else { /* Time = NULL means Immediate delivery */
1840 proto_tree_add_text(tree, tvb, offset++, 1,
1841 "Scheduled delivery time: Immediate delivery");
1843 if (tvb_get_guint8(tvb,offset)) {
1844 smpp_handle_time(tree, tvb, hf_smpp_validity_period,
1845 hf_smpp_validity_period_r, &offset);
1846 } else { /* Time = NULL means SMSC default validity */
1847 proto_tree_add_text(tree, tvb, offset++, 1,
1848 "Validity period: SMSC default validity period");
1850 flag = tvb_get_guint8(tvb, offset);
1851 proto_tree_add_item(tree, hf_smpp_regdel_receipt, tvb, offset, 1, flag);
1852 proto_tree_add_item(tree, hf_smpp_regdel_acks, tvb, offset, 1, flag);
1853 proto_tree_add_item(tree, hf_smpp_regdel_notif, tvb, offset, 1, flag);
1855 smpp_handle_int1(tree, tvb, hf_smpp_replace_if_present_flag, &offset);
1856 smpp_handle_dcs(tree, tvb, &offset);
1857 smpp_handle_int1(tree, tvb, hf_smpp_sm_default_msg_id, &offset);
1858 length = tvb_get_guint8(tvb, offset);
1859 proto_tree_add_uint(tree, hf_smpp_sm_length, tvb, offset++, 1, length);
1862 proto_tree_add_item(tree, hf_smpp_short_message,
1863 tvb, offset, length, FALSE);
1864 if (udhi) /* UDHI indicator present */
1866 DebugLog(("UDHI present - set addresses\n"));
1867 /* Save original addresses */
1868 SET_ADDRESS(&save_src, pinfo->src.type, pinfo->src.len, pinfo->src.data);
1869 SET_ADDRESS(&save_dst, pinfo->dst.type, pinfo->dst.len, pinfo->dst.data);
1870 /* Set SMPP source and destination address */
1871 SET_ADDRESS(&(pinfo->src), AT_STRINGZ, 1+(int)strlen(src_str), src_str);
1872 SET_ADDRESS(&(pinfo->dst), AT_STRINGZ, 1+(int)strlen(dst_str), dst_str);
1873 tvb_msg = tvb_new_subset (tvb, offset,
1874 MIN(length, tvb_reported_length(tvb) - offset), length);
1875 call_dissector (gsm_sms_handle, tvb_msg, pinfo, top_tree);
1876 /* Restore original addresses */
1877 SET_ADDRESS(&(pinfo->src), save_src.type, save_src.len, save_src.data );
1878 SET_ADDRESS(&(pinfo->dst), save_dst.type, save_dst.len, save_dst.data);
1882 /* Get rid of SMPP text string addresses */
1883 smpp_handle_tlv(tree, tvb, &offset);
1886 #define deliver_sm(a, b, c, d) submit_sm(a, b, c, d)
1889 replace_sm(proto_tree *tree, tvbuff_t *tvb)
1895 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
1896 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_ton, &offset);
1897 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_npi, &offset);
1898 smpp_handle_string(tree, tvb, hf_smpp_source_addr, &offset);
1899 if (tvb_get_guint8(tvb,offset)) {
1900 smpp_handle_time(tree, tvb, hf_smpp_schedule_delivery_time,
1901 hf_smpp_schedule_delivery_time_r, &offset);
1902 } else { /* Time = NULL */
1903 proto_tree_add_text(tree, tvb, offset++, 1,
1904 "Scheduled delivery time: Keep initial delivery time setting");
1906 if (tvb_get_guint8(tvb,offset)) {
1907 smpp_handle_time(tree, tvb, hf_smpp_validity_period,
1908 hf_smpp_validity_period_r, &offset);
1909 } else { /* Time = NULL */
1910 proto_tree_add_text(tree, tvb, offset++, 1,
1911 "Validity period: Keep initial validity period setting");
1913 flag = tvb_get_guint8(tvb, offset);
1914 proto_tree_add_item(tree, hf_smpp_regdel_receipt, tvb, offset, 1, flag);
1915 proto_tree_add_item(tree, hf_smpp_regdel_acks, tvb, offset, 1, flag);
1916 proto_tree_add_item(tree, hf_smpp_regdel_notif, tvb, offset, 1, flag);
1918 smpp_handle_int1(tree, tvb, hf_smpp_sm_default_msg_id, &offset);
1919 length = tvb_get_guint8(tvb, offset);
1920 proto_tree_add_uint(tree, hf_smpp_sm_length, tvb, offset++, 1, length);
1922 proto_tree_add_item(tree, hf_smpp_short_message,
1923 tvb, offset, length, FALSE);
1928 cancel_sm(proto_tree *tree, tvbuff_t *tvb)
1932 smpp_handle_string_z(tree, tvb, hf_smpp_service_type, &offset, "(Default)");
1933 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
1934 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_ton, &offset);
1935 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_npi, &offset);
1936 smpp_handle_string(tree, tvb, hf_smpp_source_addr, &offset);
1937 smpp_handle_int1(tree, tvb, hf_smpp_dest_addr_ton, &offset);
1938 smpp_handle_int1(tree, tvb, hf_smpp_dest_addr_npi, &offset);
1939 smpp_handle_string(tree, tvb, hf_smpp_destination_addr, &offset);
1943 submit_multi(proto_tree *tree, tvbuff_t *tvb)
1949 smpp_handle_string_z(tree, tvb, hf_smpp_service_type, &offset, "(Default)");
1950 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_ton, &offset);
1951 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_npi, &offset);
1952 smpp_handle_string(tree, tvb, hf_smpp_source_addr, &offset);
1954 smpp_handle_dlist(tree, tvb, &offset);
1956 flag = tvb_get_guint8(tvb, offset);
1957 proto_tree_add_item(tree, hf_smpp_esm_submit_msg_mode,
1958 tvb, offset, 1, flag);
1959 proto_tree_add_item(tree, hf_smpp_esm_submit_msg_type,
1960 tvb, offset, 1, flag);
1961 proto_tree_add_item(tree, hf_smpp_esm_submit_features,
1962 tvb, offset, 1, flag);
1964 smpp_handle_int1(tree, tvb, hf_smpp_protocol_id, &offset);
1965 smpp_handle_int1(tree, tvb, hf_smpp_priority_flag, &offset);
1966 if (tvb_get_guint8(tvb,offset)) {
1967 smpp_handle_time(tree, tvb, hf_smpp_schedule_delivery_time,
1968 hf_smpp_schedule_delivery_time_r, &offset);
1969 } else { /* Time = NULL means Immediate delivery */
1970 proto_tree_add_text(tree, tvb, offset++, 1,
1971 "Scheduled delivery time: Immediate delivery");
1973 if (tvb_get_guint8(tvb,offset)) {
1974 smpp_handle_time(tree, tvb, hf_smpp_validity_period,
1975 hf_smpp_validity_period_r, &offset);
1976 } else { /* Time = NULL means SMSC default validity */
1977 proto_tree_add_text(tree, tvb, offset++, 1,
1978 "Validity period: SMSC default validity period");
1980 flag = tvb_get_guint8(tvb, offset);
1981 proto_tree_add_item(tree, hf_smpp_regdel_receipt, tvb, offset, 1, flag);
1982 proto_tree_add_item(tree, hf_smpp_regdel_acks, tvb, offset, 1, flag);
1983 proto_tree_add_item(tree, hf_smpp_regdel_notif, tvb, offset, 1, flag);
1985 smpp_handle_int1(tree, tvb, hf_smpp_replace_if_present_flag, &offset);
1986 smpp_handle_dcs(tree, tvb, &offset);
1987 smpp_handle_int1(tree, tvb, hf_smpp_sm_default_msg_id, &offset);
1988 length = tvb_get_guint8(tvb, offset);
1989 proto_tree_add_uint(tree, hf_smpp_sm_length, tvb, offset++, 1, length);
1991 proto_tree_add_item(tree, hf_smpp_short_message,
1992 tvb, offset, length, FALSE);
1994 smpp_handle_tlv(tree, tvb, &offset);
1998 alert_notification(proto_tree *tree, tvbuff_t *tvb)
2002 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_ton, &offset);
2003 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_npi, &offset);
2004 smpp_handle_string(tree, tvb, hf_smpp_source_addr, &offset);
2005 smpp_handle_int1(tree, tvb, hf_smpp_esme_addr_ton, &offset);
2006 smpp_handle_int1(tree, tvb, hf_smpp_esme_addr_npi, &offset);
2007 smpp_handle_string(tree, tvb, hf_smpp_esme_addr, &offset);
2008 smpp_handle_tlv(tree, tvb, &offset);
2012 data_sm(proto_tree *tree, tvbuff_t *tvb)
2017 smpp_handle_string_z(tree, tvb, hf_smpp_service_type, &offset, "(Default)");
2018 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_ton, &offset);
2019 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_npi, &offset);
2020 smpp_handle_string(tree, tvb, hf_smpp_source_addr, &offset);
2021 smpp_handle_int1(tree, tvb, hf_smpp_dest_addr_ton, &offset);
2022 smpp_handle_int1(tree, tvb, hf_smpp_dest_addr_npi, &offset);
2023 smpp_handle_string(tree, tvb, hf_smpp_destination_addr, &offset);
2024 flag = tvb_get_guint8(tvb, offset);
2025 proto_tree_add_item(tree, hf_smpp_esm_submit_msg_mode,
2026 tvb, offset, 1, flag);
2027 proto_tree_add_item(tree, hf_smpp_esm_submit_msg_type,
2028 tvb, offset, 1, flag);
2029 proto_tree_add_item(tree, hf_smpp_esm_submit_features,
2030 tvb, offset, 1, flag);
2032 flag = tvb_get_guint8(tvb, offset);
2033 proto_tree_add_item(tree, hf_smpp_regdel_receipt, tvb, offset, 1, flag);
2034 proto_tree_add_item(tree, hf_smpp_regdel_acks, tvb, offset, 1, flag);
2035 proto_tree_add_item(tree, hf_smpp_regdel_notif, tvb, offset, 1, flag);
2037 smpp_handle_dcs(tree, tvb, &offset);
2038 smpp_handle_tlv(tree, tvb, &offset);
2042 * Request operations introduced in the SMPP 5.0
2045 broadcast_sm(proto_tree *tree, tvbuff_t *tvb)
2049 smpp_handle_string_z(tree, tvb, hf_smpp_service_type, &offset, "(Default)");
2050 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_ton, &offset);
2051 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_npi, &offset);
2052 smpp_handle_string(tree, tvb, hf_smpp_source_addr, &offset);
2053 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
2054 smpp_handle_int1(tree, tvb, hf_smpp_priority_flag, &offset);
2055 if (tvb_get_guint8(tvb,offset)) {
2056 smpp_handle_time(tree, tvb, hf_smpp_schedule_delivery_time,
2057 hf_smpp_schedule_delivery_time_r, &offset);
2058 } else { /* Time = NULL means Immediate delivery */
2059 proto_tree_add_text(tree, tvb, offset++, 1,
2060 "Scheduled delivery time: Immediate delivery");
2062 if (tvb_get_guint8(tvb,offset)) {
2063 smpp_handle_time(tree, tvb, hf_smpp_validity_period,
2064 hf_smpp_validity_period_r, &offset);
2065 } else { /* Time = NULL means SMSC default validity */
2066 proto_tree_add_text(tree, tvb, offset++, 1,
2067 "Validity period: SMSC default validity period");
2069 smpp_handle_int1(tree, tvb, hf_smpp_replace_if_present_flag, &offset);
2070 smpp_handle_dcs(tree, tvb, &offset);
2071 smpp_handle_int1(tree, tvb, hf_smpp_sm_default_msg_id, &offset);
2072 smpp_handle_tlv(tree, tvb, &offset);
2076 query_broadcast_sm(proto_tree *tree, tvbuff_t *tvb)
2080 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
2081 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_ton, &offset);
2082 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_npi, &offset);
2083 smpp_handle_string(tree, tvb, hf_smpp_source_addr, &offset);
2084 smpp_handle_tlv(tree, tvb, &offset);
2088 cancel_broadcast_sm(proto_tree *tree, tvbuff_t *tvb)
2092 smpp_handle_string_z(tree, tvb, hf_smpp_service_type, &offset, "(Default)");
2093 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
2094 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_ton, &offset);
2095 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_npi, &offset);
2096 smpp_handle_string(tree, tvb, hf_smpp_source_addr, &offset);
2097 smpp_handle_tlv(tree, tvb, &offset);
2101 * The next set of routines handle the different operation-responses,
2102 * associated with SMPP.
2105 bind_receiver_resp(proto_tree *tree, tvbuff_t *tvb)
2109 smpp_handle_string(tree, tvb, hf_smpp_system_id, &offset);
2110 smpp_handle_tlv(tree, tvb, &offset);
2113 #define bind_transmitter_resp(a, b) bind_receiver_resp(a, b)
2116 query_sm_resp(proto_tree *tree, tvbuff_t *tvb)
2120 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
2121 smpp_handle_time(tree, tvb, hf_smpp_final_date,
2122 hf_smpp_final_date_r, &offset);
2123 smpp_handle_int1(tree, tvb, hf_smpp_message_state, &offset);
2124 smpp_handle_int1(tree, tvb, hf_smpp_error_code, &offset);
2127 #define bind_transceiver_resp(a, b) bind_receiver_resp(a, b)
2130 submit_sm_resp(proto_tree *tree, tvbuff_t *tvb)
2134 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
2135 smpp_handle_tlv(tree, tvb, &offset);
2138 #define deliver_sm_resp(a, b) submit_sm_resp(a, b)
2141 submit_multi_resp(proto_tree *tree, tvbuff_t *tvb)
2145 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
2146 smpp_handle_dlist_resp(tree, tvb, &offset);
2147 smpp_handle_tlv(tree, tvb, &offset);
2151 data_sm_resp(proto_tree *tree, tvbuff_t *tvb)
2155 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
2156 smpp_handle_tlv(tree, tvb, &offset);
2159 #define broadcast_sm_resp(a, b) submit_sm_resp(a, b)
2162 query_broadcast_sm_resp(proto_tree *tree, tvbuff_t *tvb)
2166 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
2167 smpp_handle_tlv(tree, tvb, &offset);
2172 * A 'heuristic dissector' that attemtps to establish whether we have
2173 * a genuine SMPP PDU here.
2175 * at least the fixed header is there
2176 * it has a correct overall PDU length
2177 * it is a 'well-known' operation
2178 * has a 'well-known' status
2181 dissect_smpp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2183 guint command_id; /* SMPP command */
2184 guint command_status; /* Status code */
2185 guint command_length; /* length of PDU */
2187 if (tvb_reported_length(tvb) < SMPP_MIN_LENGTH) /* Mandatory header */
2189 command_length = tvb_get_ntohl(tvb, 0);
2190 if (command_length > 64 * 1024 || command_length < SMPP_MIN_LENGTH)
2192 command_id = tvb_get_ntohl(tvb, 4); /* Only known commands */
2193 if (match_strval(command_id, vals_command_id) == NULL)
2195 command_status = tvb_get_ntohl(tvb, 8); /* ..with known status */
2196 if (match_strval(command_status, vals_command_status) == NULL)
2198 dissect_smpp(tvb, pinfo, tree);
2203 get_smpp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
2205 return tvb_get_ntohl(tvb, offset);
2209 * This global SMPP variable is used to determine whether the PDU to dissect
2210 * is the first SMPP PDU in the packet (or reassembled buffer), requiring
2211 * different column update code than subsequent SMPP PDUs within this packet
2212 * (or reassembled buffer).
2214 * FIXME - This approach is NOT dissection multi-thread safe!
2216 static gboolean first = TRUE;
2219 dissect_smpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2222 if (pinfo->ptype == PT_TCP) { /* are we running on top of TCP */
2223 tcp_dissect_pdus(tvb, pinfo, tree,
2224 reassemble_over_tcp, /* Do we try to reassemble */
2225 16, /* Length of fixed header */
2226 get_smpp_pdu_len, /* Function returning PDU len */
2227 dissect_smpp_pdu); /* PDU dissector */
2228 } else { /* no? probably X.25 */
2230 while (tvb_reported_length_remaining(tvb, offset) > 0) {
2231 guint16 pdu_len = tvb_get_ntohl(tvb, offset);
2232 gint pdu_real_len = tvb_length_remaining(tvb, offset);
2236 THROW(ReportedBoundsError);
2238 if (pdu_real_len <= 0)
2240 if (pdu_real_len > pdu_len)
2241 pdu_real_len = pdu_len;
2242 pdu_tvb = tvb_new_subset(tvb, offset, pdu_real_len, pdu_len);
2243 dissect_smpp_pdu(pdu_tvb, pinfo, tree);
2251 /* Dissect a single SMPP PDU contained within "tvb". */
2253 dissect_smpp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2255 int offset = 0; /* Offset within tvbuff */
2256 guint command_length; /* length of PDU */
2257 guint command_id; /* SMPP command */
2258 guint command_status; /* Status code */
2259 guint sequence_number; /* ...of command */
2260 smpp_tap_rec_t* tap_rec; /* Tap record */
2261 const gchar *command_str;
2262 const gchar *command_status_str = NULL;
2263 /* Set up structures needed to add the protocol subtree and manage it */
2264 proto_item *ti = NULL;
2265 proto_tree *smpp_tree = NULL;
2268 * Safety: don't even try to dissect the PDU
2269 * when the mandatory header isn't present.
2271 if (tvb_reported_length(tvb) < SMPP_MIN_LENGTH)
2273 command_length = tvb_get_ntohl(tvb, offset);
2275 command_id = tvb_get_ntohl(tvb, offset);
2276 command_str = val_to_str(command_id, vals_command_id,
2277 "(Unknown SMPP Operation 0x%08X)");
2279 command_status = tvb_get_ntohl(tvb, offset);
2280 if (command_id & 0x80000000) {
2281 command_status_str = val_to_str(command_status, vals_command_status,
2282 "(Reserved Error 0x%08X)");
2285 sequence_number = tvb_get_ntohl(tvb, offset);
2289 * Update the protocol column.
2291 if (first == TRUE) {
2292 if (check_col(pinfo->cinfo, COL_PROTOCOL))
2293 col_set_str(pinfo->cinfo, COL_PROTOCOL, "SMPP");
2297 * Create display subtree for the protocol
2300 ti = proto_tree_add_item (tree, proto_smpp, tvb, 0, tvb->length, FALSE);
2301 smpp_tree = proto_item_add_subtree (ti, ett_smpp);
2305 * Cycle over the encapsulated PDUs
2311 * Make entries in the Info column on the summary display
2313 if (check_col(pinfo->cinfo, COL_INFO)) {
2314 if (first == TRUE) {
2316 * First PDU - We already computed the fixed header
2318 col_clear(pinfo->cinfo, COL_INFO);
2319 col_add_fstr(pinfo->cinfo, COL_INFO, "SMPP %s", command_str);
2325 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", command_str);
2328 * Display command status of responses in Info column
2330 if (command_id & 0x80000000) {
2331 col_append_fstr(pinfo->cinfo, COL_INFO, ": \"%s\"",
2332 command_status_str);
2337 * Create a tvb for the current PDU.
2338 * Physical length: at most command_length
2339 * Reported length: command_length
2341 if (tvb_length_remaining(tvb, offset - 16 + command_length) > 0) {
2342 pdu_tvb = tvb_new_subset(tvb, offset - 16,
2343 command_length, /* Physical length */
2344 command_length); /* Length reported by the protocol */
2346 pdu_tvb = tvb_new_subset(tvb, offset - 16,
2347 tvb_length_remaining(tvb, offset - 16),/* Physical length */
2348 command_length); /* Length reported by the protocol */
2354 * If "tree" is NULL, Wireshark is only interested in creation
2355 * of conversations, reassembly and subdissection but not in
2356 * the detailed protocol tree.
2357 * In the interest of speed, skip the generation of protocol tree
2358 * items when "tree" is NULL.
2360 * The only PDU which requires subdissection currently is the
2361 * sm_submit PDU (command ID = 0x00000004).
2363 if (tree || (command_id == 4))
2366 * Create display subtree for the PDU
2369 proto_tree_add_uint(smpp_tree, hf_smpp_command_length,
2370 pdu_tvb, 0, 4, command_length);
2371 proto_tree_add_uint(smpp_tree, hf_smpp_command_id,
2372 pdu_tvb, 4, 4, command_id);
2373 proto_item_append_text(ti, ", Command: %s", command_str);
2376 * Status is only meaningful with responses
2378 if (command_id & 0x80000000) {
2379 proto_tree_add_uint(smpp_tree, hf_smpp_command_status,
2380 pdu_tvb, 8, 4, command_status);
2381 proto_item_append_text (ti, ", Status: \"%s\"",
2382 command_status_str);
2384 proto_tree_add_uint(smpp_tree, hf_smpp_sequence_number,
2385 pdu_tvb, 12, 4, sequence_number);
2386 proto_item_append_text(ti, ", Seq: %u, Len: %u",
2387 sequence_number, command_length);
2391 * End of fixed header.
2392 * Don't dissect variable part if it is shortened.
2394 * FIXME - We then do not report a Short Frame or Malformed Packet
2396 if (command_length <= tvb_reported_length(pdu_tvb))
2398 tvbuff_t *tmp_tvb = tvb_new_subset(pdu_tvb, 16,
2399 -1, command_length - 16);
2400 if (command_id & 0x80000000)
2402 switch (command_id & 0x7FFFFFFF) {
2404 * All of these only have a fixed header
2406 case 0: /* Generic nack */
2407 case 6: /* Unbind resp */
2408 case 7: /* Replace SM resp */
2409 case 8: /* Cancel SM resp */
2410 case 21: /* Enquire link resp */
2411 case 275: /* Cancel Broadcast SM resp */
2413 /* FIXME: The body of the response PDUs are only
2414 * only dissected if the request was successful.
2415 * However, in SMPP 5.0 some responses might
2416 * contain body to provide additional information
2417 * about the error. This needs to be handled.
2420 if (!command_status)
2421 bind_receiver_resp(smpp_tree, tmp_tvb);
2424 if (!command_status)
2425 bind_transmitter_resp(smpp_tree, tmp_tvb);
2428 if (!command_status)
2429 query_sm_resp(smpp_tree, tmp_tvb);
2432 if (!command_status)
2433 submit_sm_resp(smpp_tree, tmp_tvb);
2436 if (!command_status)
2437 deliver_sm_resp(smpp_tree, tmp_tvb);
2440 if (!command_status)
2441 bind_transceiver_resp(smpp_tree, tmp_tvb);
2444 if (!command_status)
2445 submit_multi_resp(smpp_tree, tmp_tvb);
2448 if (!command_status)
2449 data_sm_resp(smpp_tree, tmp_tvb);
2452 if (!command_status)
2453 broadcast_sm_resp(smpp_tree, tmp_tvb);
2456 if (!command_status)
2457 query_broadcast_sm_resp(smpp_tree, tmp_tvb);
2461 } /* switch (command_id & 0x7FFFFFFF) */
2465 switch (command_id) {
2467 bind_receiver(smpp_tree, tmp_tvb);
2470 bind_transmitter(smpp_tree, tmp_tvb);
2473 query_sm(smpp_tree, tmp_tvb);
2476 submit_sm(smpp_tree, tmp_tvb, pinfo, tree);
2479 deliver_sm(smpp_tree, tmp_tvb, pinfo, tree);
2481 case 6: /* Unbind */
2482 case 21: /* Enquire link */
2485 replace_sm(smpp_tree, tmp_tvb);
2488 cancel_sm(smpp_tree, tmp_tvb);
2491 bind_transceiver(smpp_tree, tmp_tvb);
2494 outbind(smpp_tree, tmp_tvb);
2497 submit_multi(smpp_tree, tmp_tvb);
2500 alert_notification(smpp_tree, tmp_tvb);
2503 data_sm(smpp_tree, tmp_tvb);
2506 broadcast_sm(smpp_tree, tmp_tvb);
2509 query_broadcast_sm(smpp_tree, tmp_tvb);
2512 cancel_broadcast_sm(smpp_tree, tmp_tvb);
2516 } /* switch (command_id) */
2517 } /* if (command_id & 0x80000000) */
2519 } /* if (command_length <= tvb_reported_length(pdu_tvb)) */
2520 offset += command_length;
2521 } /* if (tree || (command_id == 4)) */
2523 /* Queue packet for Tap */
2524 tap_rec = ep_alloc0(sizeof(smpp_tap_rec_t));
2525 tap_rec->command_id = command_id;
2526 tap_rec->command_status = command_status;
2527 tap_queue_packet(smpp_tap, pinfo, tap_rec);
2536 /* Register the protocol with Wireshark */
2538 proto_register_smpp(void)
2540 module_t *smpp_module; /* Preferences for SMPP */
2542 /* Setup list of header fields */
2543 static hf_register_info hf[] = {
2544 { &hf_smpp_command_length,
2545 { "Length ", "smpp.command_length",
2546 FT_UINT32, BASE_DEC, NULL, 0x00,
2547 "Total length of the SMPP PDU.",
2551 { &hf_smpp_command_id,
2552 { "Operation ", "smpp.command_id",
2553 FT_UINT32, BASE_HEX, VALS(vals_command_id), 0x00,
2554 "Defines the SMPP PDU.",
2558 { &hf_smpp_command_status,
2559 { "Result ", "smpp.command_status",
2560 FT_UINT32, BASE_HEX, VALS(vals_command_status), 0x00,
2561 "Indicates success or failure of the SMPP request.",
2565 { &hf_smpp_sequence_number,
2566 { "Sequence #", "smpp.sequence_number",
2567 FT_UINT32, BASE_DEC, NULL, 0x00,
2568 "A number to correlate requests with responses.",
2572 { &hf_smpp_system_id,
2573 { "System ID", "smpp.system_id",
2574 FT_STRING, BASE_NONE, NULL, 0x00,
2575 "Identifies a system.",
2579 { &hf_smpp_password,
2580 { "Password", "smpp.password",
2581 FT_STRING, BASE_NONE, NULL, 0x00,
2582 "Password used for authentication.",
2586 { &hf_smpp_system_type,
2587 { "System type", "smpp.system_type",
2588 FT_STRING, BASE_NONE, NULL, 0x00,
2589 "Categorizes the system.",
2593 { &hf_smpp_interface_version,
2594 { "Version (if)", "smpp.interface_version",
2595 FT_STRING, BASE_NONE, NULL, 0x00,
2596 "Version of SMPP interface supported.",
2600 { &hf_smpp_service_type,
2601 { "Service type", "smpp.service_type",
2602 FT_STRING, BASE_NONE, NULL, 0x00,
2603 "SMS application service associated with the message.",
2607 { &hf_smpp_addr_ton,
2608 { "Type of number", "smpp.addr_ton",
2609 FT_UINT8, BASE_HEX, VALS(vals_addr_ton), 0x00,
2610 "Indicates the type of number, given in the address.",
2614 { &hf_smpp_source_addr_ton,
2615 { "Type of number (originator)", "smpp.source_addr_ton",
2616 FT_UINT8, BASE_HEX, VALS(vals_addr_ton), 0x00,
2617 "Indicates originator type of number, given in the address.",
2621 { &hf_smpp_dest_addr_ton,
2622 { "Type of number (recipient)", "smpp.dest_addr_ton",
2623 FT_UINT8, BASE_HEX, VALS(vals_addr_ton), 0x00,
2624 "Indicates recipient type of number, given in the address.",
2628 { &hf_smpp_addr_npi,
2629 { "Numbering plan indicator", "smpp.addr_npi",
2630 FT_UINT8, BASE_HEX, VALS(vals_addr_npi), 0x00,
2631 "Gives the numbering plan this address belongs to.",
2635 { &hf_smpp_source_addr_npi,
2636 { "Numbering plan indicator (originator)", "smpp.source_addr_npi",
2637 FT_UINT8, BASE_HEX, VALS(vals_addr_npi), 0x00,
2638 "Gives originator numbering plan this address belongs to.",
2642 { &hf_smpp_dest_addr_npi,
2643 { "Numbering plan indicator (recipient)", "smpp.dest_addr_npi",
2644 FT_UINT8, BASE_HEX, VALS(vals_addr_npi), 0x00,
2645 "Gives recipient numbering plan this address belongs to.",
2649 { &hf_smpp_address_range,
2650 { "Address", "smpp.address_range",
2651 FT_STRING, BASE_NONE, NULL, 0x00,
2652 "Given address or address range.",
2656 { &hf_smpp_source_addr,
2657 { "Originator address", "smpp.source_addr",
2658 FT_STRING, BASE_NONE, NULL, 0x00,
2659 "Address of SME originating this message.",
2663 { &hf_smpp_destination_addr,
2664 { "Recipient address", "smpp.destination_addr",
2665 FT_STRING, BASE_NONE, NULL, 0x00,
2666 "Address of SME receiving this message.",
2670 { &hf_smpp_esm_submit_msg_mode,
2671 { "Messaging mode", "smpp.esm.submit.msg_mode",
2672 FT_UINT8, BASE_HEX, VALS(vals_esm_submit_msg_mode), 0x03,
2673 "Mode attribute for this message.",
2677 { &hf_smpp_esm_submit_msg_type,
2678 { "Message type ", "smpp.esm.submit.msg_type",
2679 FT_UINT8, BASE_HEX, VALS(vals_esm_submit_msg_type), 0x3C,
2680 "Type attribute for this message.",
2684 { &hf_smpp_esm_submit_features,
2685 { "GSM features ", "smpp.esm.submit.features",
2686 FT_UINT8, BASE_HEX, VALS(vals_esm_submit_features), 0xC0,
2687 "GSM network specific features.",
2691 /*! \todo Get proper values from GSM-spec. */
2692 { &hf_smpp_protocol_id,
2693 { "Protocol id.", "smpp.protocol_id",
2694 FT_UINT8, BASE_HEX, NULL, 0x00,
2695 "Protocol identifier according GSM 03.40.",
2699 { &hf_smpp_priority_flag,
2700 { "Priority level", "smpp.priority_flag",
2701 FT_UINT8, BASE_HEX, VALS(vals_priority_flag), 0x00,
2702 "The priority level of the short message.",
2706 { &hf_smpp_schedule_delivery_time,
2707 { "Scheduled delivery time", "smpp.schedule_delivery_time",
2708 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2709 "Scheduled time for delivery of short message.",
2713 { &hf_smpp_schedule_delivery_time_r,
2714 { "Scheduled delivery time", "smpp.schedule_delivery_time_r",
2715 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
2716 "Scheduled time for delivery of short message.",
2720 { &hf_smpp_validity_period,
2721 { "Validity period", "smpp.validity_period",
2722 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2723 "Validity period of this message.",
2727 { &hf_smpp_validity_period_r,
2728 { "Validity period", "smpp.validity_period_r",
2729 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
2730 "Validity period of this message.",
2734 { &hf_smpp_regdel_receipt,
2735 { "Delivery receipt ", "smpp.regdel.receipt",
2736 FT_UINT8, BASE_HEX, VALS(vals_regdel_receipt), 0x03,
2737 "SMSC delivery receipt request.",
2741 { &hf_smpp_regdel_acks,
2742 { "Message type ", "smpp.regdel.acks",
2743 FT_UINT8, BASE_HEX, VALS(vals_regdel_acks), 0x0C,
2744 "SME acknowledgement request.",
2748 { &hf_smpp_regdel_notif,
2749 { "Intermediate notif", "smpp.regdel.notif",
2750 FT_UINT8, BASE_HEX, VALS(vals_regdel_notif), 0x10,
2751 "Intermediate notification request.",
2755 { &hf_smpp_replace_if_present_flag,
2756 { "Replace ", "smpp.replace_if_present_flag",
2757 FT_UINT8, BASE_HEX, VALS(vals_replace_if_present_flag), 0x01,
2758 "Replace the short message with this one or not.",
2762 { &hf_smpp_data_coding,
2763 { "Data coding", "smpp.data_coding",
2764 FT_UINT8, BASE_HEX, NULL, 0x00,
2765 "Defines the encoding scheme of the message.",
2769 { &hf_smpp_sm_default_msg_id,
2770 { "Predefined message", "smpp.sm_default_msg_id",
2771 FT_UINT8, BASE_DEC, NULL, 0x00,
2772 "Index of a predefined ('canned') short message.",
2776 { &hf_smpp_sm_length,
2777 { "Message length", "smpp.sm_length",
2778 FT_UINT8, BASE_DEC, NULL, 0x00,
2779 "Length of the message content.",
2783 { &hf_smpp_short_message,
2784 { "Message", "smpp.message",
2785 FT_NONE, BASE_NONE, NULL, 0x00,
2786 "The actual message or data.",
2790 { &hf_smpp_message_id,
2791 { "Message id.", "smpp.message_id",
2792 FT_STRING, BASE_NONE, NULL, 0x00,
2793 "Identifier of the submitted short message.",
2798 { "Destination list", "smpp.dlist",
2799 FT_NONE, BASE_NONE, NULL, 0x00,
2800 "The list of destinations for a short message.",
2804 { &hf_smpp_dlist_resp,
2805 { "Unsuccessful delivery list", "smpp.dlist_resp",
2806 FT_NONE, BASE_NONE, NULL, 0x00,
2807 "The list of unsuccessful deliveries to destinations.",
2812 { "Distr. list name", "smpp.dl_name",
2813 FT_STRING, BASE_NONE, NULL, 0x00,
2814 "The name of the distribution list.",
2818 { &hf_smpp_final_date,
2819 { "Final date", "smpp.final_date",
2820 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2821 "Date-time when the queried message reached a final state.",
2825 { &hf_smpp_final_date_r,
2826 { "Final date", "smpp.final_date_r",
2827 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
2828 "Date-time when the queried message reached a final state.",
2832 { &hf_smpp_message_state,
2833 { "Message state", "smpp.message_state",
2834 FT_UINT8, BASE_DEC, VALS(vals_message_state), 0x00,
2835 "Specifies the status of the queried short message.",
2839 { &hf_smpp_error_code,
2840 { "Error code", "smpp.error_code",
2841 FT_UINT8, BASE_DEC, NULL, 0x00,
2842 "Network specific error code defining reason for failure.",
2846 { &hf_smpp_error_status_code,
2847 { "Status", "smpp.error_status_code",
2848 FT_UINT32, BASE_HEX, VALS(vals_command_status), 0x00,
2849 "Indicates success/failure of request for this address.",
2853 { &hf_smpp_esme_addr_ton,
2854 { "Type of number (ESME)", "smpp.esme_addr_ton",
2855 FT_UINT8, BASE_HEX, VALS(vals_addr_ton), 0x00,
2856 "Indicates recipient type of number, given in the address.",
2860 { &hf_smpp_esme_addr_npi,
2861 { "Numbering plan indicator (ESME)", "smpp.esme_addr_npi",
2862 FT_UINT8, BASE_HEX, VALS(vals_addr_npi), 0x00,
2863 "Gives the numbering plan this address belongs to.",
2867 { &hf_smpp_esme_addr,
2868 { "ESME address", "smpp.esme_addr",
2869 FT_STRING, BASE_NONE, NULL, 0x00,
2870 "Address of ESME originating this message.",
2874 { &hf_smpp_dest_addr_subunit,
2875 { "Subunit destination", "smpp.dest_addr_subunit",
2876 FT_UINT8, BASE_HEX, VALS(vals_addr_subunit), 0x00,
2877 "Subunit address within mobile to route message to.",
2881 { &hf_smpp_source_addr_subunit,
2882 { "Subunit origin", "smpp.source_addr_subunit",
2883 FT_UINT8, BASE_HEX, VALS(vals_addr_subunit), 0x00,
2884 "Subunit address within mobile that generated the message.",
2888 { &hf_smpp_dest_network_type,
2889 { "Destination network", "smpp.dest_network_type",
2890 FT_UINT8, BASE_HEX, VALS(vals_network_type), 0x00,
2891 "Network associated with the destination address.",
2895 { &hf_smpp_source_network_type,
2896 { "Originator network", "smpp.source_network_type",
2897 FT_UINT8, BASE_HEX, VALS(vals_network_type), 0x00,
2898 "Network associated with the originator address.",
2902 { &hf_smpp_dest_bearer_type,
2903 { "Destination bearer", "smpp.dest_bearer_type",
2904 FT_UINT8, BASE_HEX, VALS(vals_bearer_type), 0x00,
2905 "Desired bearer for delivery of message.",
2909 { &hf_smpp_source_bearer_type,
2910 { "Originator bearer", "smpp.source_bearer_type",
2911 FT_UINT8, BASE_HEX, VALS(vals_bearer_type), 0x00,
2912 "Bearer over which the message originated.",
2916 { &hf_smpp_dest_telematics_id,
2917 { "Telematic interworking (dest)", "smpp.dest_telematics_id",
2918 FT_UINT16, BASE_HEX, NULL, 0x00,
2919 "Telematic interworking to be used for message delivery.",
2923 { &hf_smpp_source_telematics_id,
2924 { "Telematic interworking (orig)", "smpp.source_telematics_id",
2925 FT_UINT16, BASE_HEX, NULL, 0x00,
2926 "Telematic interworking used for message submission.",
2930 { &hf_smpp_qos_time_to_live,
2931 { "Validity period", "smpp.qos_time_to_live",
2932 FT_UINT32, BASE_DEC, NULL, 0x00,
2933 "Number of seconds to retain message before expiry.",
2937 { &hf_smpp_payload_type,
2938 { "Payload", "smpp.payload_type",
2939 FT_UINT8, BASE_DEC, VALS(vals_payload_type), 0x00,
2940 "PDU type contained in the message payload.",
2944 { &hf_smpp_additional_status_info_text,
2945 { "Information", "smpp.additional_status_info_text",
2946 FT_STRING, BASE_NONE, NULL, 0x00,
2947 "Description of the meaning of a response PDU.",
2951 { &hf_smpp_receipted_message_id,
2952 { "SMSC identifier", "smpp.receipted_message_id",
2953 FT_STRING, BASE_NONE, NULL, 0x00,
2954 "SMSC handle of the message being received.",
2958 { &hf_smpp_privacy_indicator,
2959 { "Privacy indicator", "smpp.privacy_indicator",
2960 FT_UINT8, BASE_DEC, VALS(vals_privacy_indicator), 0x00,
2961 "Indicates the privacy level of the message.",
2965 { &hf_smpp_source_subaddress,
2966 { "Source Subaddress", "smpp.source_subaddress",
2967 FT_BYTES, BASE_HEX, NULL, 0x00,
2968 "Source Subaddress",
2972 { &hf_smpp_dest_subaddress,
2973 { "Destination Subaddress", "smpp.dest_subaddress",
2974 FT_BYTES, BASE_HEX, NULL, 0x00,
2975 "Destination Subaddress",
2979 { &hf_smpp_user_message_reference,
2980 { "Message reference", "smpp.user_message_reference",
2981 FT_UINT16, BASE_HEX, NULL, 0x00,
2982 "Reference to the message, assigned by the user.",
2986 { &hf_smpp_user_response_code,
2987 { "Application response code", "smpp.user_response_code",
2988 FT_UINT8, BASE_HEX, NULL, 0x00,
2989 "A response code set by the user.",
2993 { &hf_smpp_language_indicator,
2994 { "Language", "smpp.language_indicator",
2995 FT_UINT8, BASE_DEC, VALS(vals_language_indicator), 0x00,
2996 "Indicates the language of the short message.",
3000 { &hf_smpp_source_port,
3001 { "Source port", "smpp.source_port",
3002 FT_UINT16, BASE_HEX, NULL, 0x00,
3003 "Application port associated with the source of the message.",
3007 { &hf_smpp_destination_port,
3008 { "Destination port", "smpp.destination_port",
3009 FT_UINT16, BASE_HEX, NULL, 0x00,
3010 "Application port associated with the destination of the message.",
3014 { &hf_smpp_sar_msg_ref_num,
3015 { "SAR reference number", "smpp.sar_msg_ref_num",
3016 FT_UINT16, BASE_DEC, NULL, 0x00,
3017 "Reference number for a concatenated short message.",
3021 { &hf_smpp_sar_total_segments,
3022 { "SAR size", "smpp.sar_total_segments",
3023 FT_UINT16, BASE_DEC, NULL, 0x00,
3024 "Number of segments of a concatenated short message.",
3028 { &hf_smpp_sar_segment_seqnum,
3029 { "SAR sequence number", "smpp.sar_segment_seqnum",
3030 FT_UINT8, BASE_DEC, NULL, 0x00,
3031 "Segment number within a concatenated short message.",
3035 { &hf_smpp_display_time,
3036 { "Display time", "smpp.display_time",
3037 FT_UINT8, BASE_DEC, VALS(vals_display_time), 0x00,
3038 "Associates a display time with the message on the handset.",
3042 { &hf_smpp_sms_signal,
3043 { "SMS signal", "smpp.sms_signal",
3044 FT_UINT16, BASE_HEX, NULL, 0x00,
3045 "Alert the user according to the information contained within this information element.",
3049 { &hf_smpp_ms_validity,
3050 { "Validity info", "smpp.ms_validity",
3051 FT_UINT8, BASE_DEC, VALS(vals_ms_validity), 0x00,
3052 "Associates validity info with the message on the handset.",
3056 { &hf_smpp_dpf_result,
3057 { "Delivery pending set?", "smpp.dpf_result",
3058 FT_UINT8, BASE_DEC, VALS(vals_dpf_result), 0x00,
3059 "Indicates whether Delivery Pending Flag was set.",
3064 { "Request DPF set", "smpp.set_dpf",
3065 FT_UINT8, BASE_DEC, VALS(vals_set_dpf), 0x00,
3066 "Request to set the DPF for certain failure scenario's.",
3070 { &hf_smpp_ms_availability_status,
3071 { "Availability status", "smpp.ms_availability_status",
3072 FT_UINT8, BASE_DEC, VALS(vals_ms_availability_status), 0x00,
3073 "Indicates the availability state of the handset.",
3077 { &hf_smpp_delivery_failure_reason,
3078 { "Delivery failure reason", "smpp.delivery_failure_reason",
3079 FT_UINT8, BASE_DEC, VALS(vals_delivery_failure_reason), 0x00,
3080 "Indicates the reason for a failed delivery attempt.",
3084 { &hf_smpp_more_messages_to_send,
3085 { "More messages?", "smpp.more_messages_to_send",
3086 FT_UINT8, BASE_DEC, VALS(vals_more_messages_to_send), 0x00,
3087 "Indicates more messages pending for the same destination.",
3091 { &hf_smpp_number_of_messages,
3092 { "Number of messages", "smpp.number_of_messages",
3093 FT_UINT8, BASE_DEC, NULL, 0x00,
3094 "Indicates number of messages stored in a mailbox.",
3098 { &hf_smpp_its_reply_type,
3099 { "Reply method", "smpp.its_reply_type",
3100 FT_UINT8, BASE_DEC, VALS(vals_its_reply_type), 0x00,
3101 "Indicates the handset reply method on message receipt.",
3105 { &hf_smpp_ussd_service_op,
3106 { "USSD service operation", "smpp.ussd_service_op",
3107 FT_UINT8, BASE_DEC, VALS(vals_ussd_service_op), 0x00,
3108 "Indicates the USSD service operation.",
3112 { &hf_smpp_vendor_op,
3113 { "Value", "smpp.vendor_op",
3114 FT_BYTES, BASE_NONE, NULL, 0x00,
3115 "A supplied optional parameter specific to an SMSC-vendor.",
3119 { &hf_smpp_reserved_op,
3120 { "Value", "smpp.reserved_op",
3121 FT_BYTES, BASE_NONE, NULL, 0x00,
3122 "An optional parameter that is reserved in this version.",
3126 { &hf_smpp_msg_wait_ind,
3127 { "Indication", "smpp.msg_wait.ind",
3128 FT_UINT8, BASE_HEX, VALS(vals_msg_wait_ind), 0x80,
3129 "Indicates to the handset that a message is waiting.",
3133 { &hf_smpp_msg_wait_type,
3134 { "Type ", "smpp.msg_wait.type",
3135 FT_UINT8, BASE_HEX, VALS(vals_msg_wait_type), 0x03,
3136 "Indicates type of message that is waiting.",
3140 { &hf_smpp_SC_interface_version,
3141 { "SMSC-supported version", "smpp.SC_interface_version",
3142 FT_STRING, BASE_NONE, NULL, 0x00,
3143 "Version of SMPP interface supported by the SMSC.",
3147 { &hf_smpp_callback_num_pres,
3148 { "Presentation", "smpp.callback_num.pres",
3149 FT_UINT8, BASE_HEX, VALS(vals_callback_num_pres), 0x0C,
3150 "Controls the presentation indication.",
3154 { &hf_smpp_callback_num_scrn,
3155 { "Screening ", "smpp.callback_num.scrn",
3156 FT_UINT8, BASE_HEX, VALS(vals_callback_num_scrn), 0x03,
3157 "Controls screening of the callback-number.",
3161 { &hf_smpp_callback_num_atag,
3162 { "Callback number - alphanumeric display tag",
3163 "smpp.callback_num_atag",
3164 FT_NONE, BASE_NONE, NULL, 0x00,
3165 "Associates an alphanumeric display with call back number.",
3169 { &hf_smpp_callback_num,
3170 { "Callback number", "smpp.callback_num",
3171 FT_NONE, BASE_NONE, NULL, 0x00,
3172 "Associates a call back number with the message.",
3176 { &hf_smpp_network_error_type,
3177 { "Error type", "smpp.network_error.type",
3178 FT_UINT8, BASE_DEC, VALS(vals_network_error_type), 0x00,
3179 "Indicates the network type.",
3183 { &hf_smpp_network_error_code,
3184 { "Error code", "smpp.network_error.code",
3185 FT_UINT16, BASE_HEX, NULL, 0x00,
3186 "Gives the actual network error code.",
3190 { &hf_smpp_message_payload,
3191 { "Payload", "smpp.message_payload",
3192 FT_NONE, BASE_NONE, NULL, 0x00,
3193 "Short message user data.",
3197 { &hf_smpp_alert_on_message_delivery_null,
3198 { "Alert on delivery", "smpp.alert_on_message_delivery",
3199 FT_NONE, BASE_NONE, NULL, 0x00,
3200 "Instructs the handset to alert user on message delivery.",
3204 { &hf_smpp_alert_on_message_delivery,
3205 { "Alert on delivery", "smpp.alert_on_message_delivery",
3206 FT_UINT8, BASE_DEC, VALS(vals_alert_on_message_delivery), 0x00,
3207 "Instructs the handset to alert user on message delivery.",
3211 { &hf_smpp_its_session_number,
3212 { "Session number", "smpp.its_session.number",
3213 FT_UINT8, BASE_DEC, NULL, 0x00,
3214 "Session number of interactive teleservice.",
3218 { &hf_smpp_its_session_sequence,
3219 { "Sequence number ", "smpp.its_session.sequence",
3220 FT_UINT8, BASE_HEX, NULL, 0xFE,
3221 "Sequence number of the dialogue unit.",
3225 { &hf_smpp_its_session_ind,
3226 { "Session indicator", "smpp.its_session.ind",
3227 FT_UINT8, BASE_HEX, VALS(vals_its_session_ind), 0x01,
3228 "Indicates whether this message is end of conversation.",
3232 { &hf_smpp_opt_params,
3233 { "Optional parameters", "smpp.opt_params",
3234 FT_NONE, BASE_NONE, NULL, 0x00,
3235 "The list of optional parameters in this operation.",
3239 { &hf_smpp_opt_param,
3240 { "Optional parameter", "smpp.opt_param",
3241 FT_NONE, BASE_NONE, NULL, 0x00,
3242 "Optional parameter",
3246 { &hf_smpp_opt_param_tag,
3247 { "Tag", "smpp.opt_param_tag",
3248 FT_UINT16, BASE_HEX, NULL, 0x00,
3249 "Optional parameter intentifier tag",
3253 { &hf_smpp_opt_param_len,
3254 { "Length", "smpp.opt_param_len",
3255 FT_UINT16, BASE_DEC, NULL, 0x00,
3256 "Optional parameter length",
3262 * Data Coding Scheme
3265 { "SMPP Data Coding Scheme", "smpp.dcs",
3266 FT_UINT8, BASE_HEX, VALS(vals_data_coding), 0x00,
3267 "Data Coding Scheme according to SMPP.",
3271 { &hf_smpp_dcs_sms_coding_group,
3272 { "DCS Coding Group for SMS", "smpp.dcs.sms_coding_group",
3273 FT_UINT8, BASE_HEX, VALS(vals_dcs_sms_coding_group), 0xF0,
3274 "Data Coding Scheme coding group for GSM Short Message Service.",
3278 { &hf_smpp_dcs_text_compression,
3279 { "DCS Text compression", "smpp.dcs.text_compression",
3280 FT_BOOLEAN, 8, TFS(&tfs_dcs_text_compression), 0x20,
3281 "Indicates if text compression is used.", HFILL
3284 { &hf_smpp_dcs_class_present,
3285 { "DCS Class present", "smpp.dcs.class_present",
3286 FT_BOOLEAN, 8, TFS(&tfs_dcs_class_present), 0x10,
3287 "Indicates if the message class is present (defined).", HFILL
3290 { &hf_smpp_dcs_charset,
3291 { "DCS Character set", "smpp.dcs.charset",
3292 FT_UINT8, BASE_HEX, VALS(vals_dcs_charset), 0x0C,
3293 "Specifies the character set used in the message.", HFILL
3296 { &hf_smpp_dcs_class,
3297 { "DCS Message class", "smpp.dcs.class",
3298 FT_UINT8, BASE_HEX, VALS(vals_dcs_class), 0x03,
3299 "Specifies the message class.", HFILL
3302 { &hf_smpp_dcs_cbs_coding_group,
3303 { "DCS Coding Group for CBS", "smpp.dcs.cbs_coding_group",
3304 FT_UINT8, BASE_HEX, VALS(vals_dcs_cbs_coding_group), 0xF0,
3305 "Data Coding Scheme coding group for GSM Cell Broadcast Service.",
3309 { &hf_smpp_dcs_cbs_language,
3310 { "DCS CBS Message language", "smpp.dcs.cbs_language",
3311 FT_UINT8, BASE_HEX, VALS(vals_dcs_cbs_language), 0x3F,
3312 "Language of the GSM Cell Broadcast Service message.", HFILL
3315 { &hf_smpp_dcs_cbs_class,
3316 { "DCS CBS Message class", "smpp.dcs.cbs_class",
3317 FT_UINT8, BASE_HEX, VALS(vals_dcs_cbs_class), 0x03,
3318 "Specifies the message class for GSM Cell Broadcast Service, "
3319 "for the Data coding / message handling code group.", HFILL
3322 { &hf_smpp_dcs_wap_charset,
3323 { "DCS Message coding", "smpp.dcs.wap_coding",
3324 FT_UINT8, BASE_HEX, VALS(vals_dcs_wap_charset), 0x0C,
3325 "Specifies the used message encoding, "
3326 "as specified by the WAP Forum (WAP over GSM USSD).", HFILL
3329 { &hf_smpp_dcs_wap_class,
3330 { "DCS CBS Message class", "smpp.dcs.wap_class",
3331 FT_UINT8, BASE_HEX, VALS(vals_dcs_wap_class), 0x03,
3332 "Specifies the message class for GSM Cell Broadcast Service, "
3333 "as specified by the WAP Forum (WAP over GSM USSD).", HFILL
3336 /* Changes in SMPP 5.0 */
3337 { &hf_smpp_congestion_state,
3338 { "Congestion State", "smpp.congestion_state",
3339 FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(vals_congestion_state), 0x00,
3340 "Congestion info between ESME and MC for flow control/cong. control", HFILL
3343 { &hf_smpp_billing_identification,
3344 { "Billing Identification", "smpp.billing_id",
3345 FT_BYTES, BASE_NONE, NULL, 0x00,
3346 "Billing identification info", HFILL
3349 { &hf_smpp_dest_addr_np_country,
3350 { "Destination Country Code", "smpp.dest_addr_np_country",
3351 FT_BYTES, BASE_NONE, NULL, 0x00,
3352 "Destination Country Code (E.164 Region Code)", HFILL
3355 { &hf_smpp_dest_addr_np_information,
3356 { "Number Portability information", "smpp.dest_addr_np_info",
3357 FT_BYTES, BASE_NONE, NULL, 0x00,
3358 "Number Portability information", HFILL
3361 { &hf_smpp_dest_addr_np_resolution,
3362 { "Number Portability query information", "smpp.dest_addr_np_resolution",
3363 FT_UINT8, BASE_DEC, VALS(vals_dest_addr_np_resolution), 0x00,
3364 "Number Portability query information - method used to resolve number", HFILL
3367 { &hf_smpp_source_network_id,
3368 { "Source Network ID", "smpp.source_network_id",
3369 FT_STRING, BASE_NONE, NULL, 0x00,
3370 "Unique ID for a network or ESME operator", HFILL
3373 { &hf_smpp_source_node_id,
3374 { "Source Node ID", "smpp.source_node_id",
3375 FT_BYTES, BASE_NONE, NULL, 0x00,
3376 "Unique ID for a ESME or MC node", HFILL
3379 { &hf_smpp_dest_network_id,
3380 { "Destination Network ID", "smpp.dest_network_id",
3381 FT_STRING, BASE_NONE, NULL, 0x00,
3382 "Unique ID for a network or ESME operator", HFILL
3385 { &hf_smpp_dest_node_id,
3386 { "Destination Node ID", "smpp.dest_node_id",
3387 FT_BYTES, BASE_NONE, NULL, 0x00,
3388 "Unique ID for a ESME or MC node", HFILL
3391 { &hf_smpp_broadcast_channel_indicator,
3392 { "Cell Broadcast channel", "smpp.broadcast_channel_indicator",
3393 FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(vals_broadcast_channel_indicator), 0x00,
3394 "Cell Broadcast channel", HFILL
3397 { &hf_smpp_broadcast_content_type_nw,
3398 { "Broadcast Content Type - Network Tag", "smpp.broadcast_content_type.nw",
3399 FT_UINT8, BASE_DEC, VALS(vals_broadcast_content_type_nw), 0x00,
3400 "Cell Broadcast content type", HFILL
3403 { &hf_smpp_broadcast_content_type_type,
3404 { "Broadcast Content Type - Content Type", "smpp.broadcast_content_type.type",
3405 FT_UINT16, BASE_HEX, VALS(vals_broadcast_content_type_type), 0x00,
3406 "Cell Broadcast content type", HFILL
3409 { &hf_smpp_broadcast_content_type_info,
3410 { "Broadcast Content Type Info", "smpp.broadcast_content_type.type",
3411 FT_BYTES, BASE_NONE, NULL, 0x00,
3412 "Cell Broadcast content type Info", HFILL
3415 { &hf_smpp_broadcast_message_class,
3416 { "Broadcast Message Class", "smpp.broadcast_message_class",
3417 FT_UINT8, BASE_HEX, VALS(vals_broadcast_message_class), 0x00,
3418 "Cell Broadcast Message Class", HFILL
3421 { &hf_smpp_broadcast_rep_num,
3422 { "Broadcast Message - Number of repetitions requested", "smpp.broadcast_rep_num",
3423 FT_UINT16, BASE_DEC, NULL, 0x00,
3424 "Cell Broadcast Message - Number of repetitions requested", HFILL
3427 { &hf_smpp_broadcast_frequency_interval_unit,
3428 { "Broadcast Message - frequency interval - Unit", "smpp.broadcast_frequency_interval.unit",
3429 FT_UINT8, BASE_HEX, VALS(vals_broadcast_frequency_interval_unit), 0x00,
3430 "Cell Broadcast Message - frequency interval at which broadcast must be repeated", HFILL
3433 { &hf_smpp_broadcast_frequency_interval_value,
3434 { "Broadcast Message - frequency interval - Unit", "smpp.broadcast_frequency_interval.value",
3435 FT_UINT16, BASE_DEC, NULL, 0x00,
3436 "Cell Broadcast Message - frequency interval at which broadcast must be repeated", HFILL
3439 { &hf_smpp_broadcast_area_identifier,
3440 { "Broadcast Message - Area Identifier", "smpp.broadcast_area_identifier",
3441 FT_BYTES, BASE_NONE, NULL, 0x00,
3442 "Cell Broadcast Message - Area Identifier", HFILL
3445 { &hf_smpp_broadcast_area_identifier_format,
3446 { "Broadcast Message - Area Identifier Format", "smpp.broadcast_area_identifier.format",
3447 FT_UINT8, BASE_HEX | BASE_RANGE_STRING, RVALS(vals_broadcast_area_identifier_format), 0x00,
3448 "Cell Broadcast Message - Area Identifier Format", HFILL
3451 { &hf_smpp_broadcast_error_status,
3452 { "Broadcast Message - Error Status", "smpp.broadcast_error_status",
3453 FT_UINT32, BASE_HEX, VALS(vals_command_status), 0x00,
3454 "Cell Broadcast Message - Error Status", HFILL
3457 { &hf_smpp_broadcast_area_success,
3458 { "Broadcast Message - Area Success", "smpp.broadcast_area_success",
3459 FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(vals_broadcast_area_success), 0x00,
3460 "Cell Broadcast Message - success rate indicator (ratio) - No. of BTS which accepted Message:Total BTS", HFILL
3463 { &hf_smpp_broadcast_end_time,
3464 { "Broadcast Message - End Time", "smpp.broadcast_end_time",
3465 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
3466 "Cell Broadcast Message - Date and time at which MC set the state of the message to terminated", HFILL
3469 { &hf_smpp_broadcast_end_time_r,
3470 { "Broadcast Message - End Time", "smpp.broadcast_end_time_r",
3471 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
3472 "Cell Broadcast Message - Date and time at which MC set the state of the message to terminated", HFILL
3475 { &hf_smpp_broadcast_service_group,
3476 { "Broadcast Message - Service Group", "smpp.broadcast_service_group",
3477 FT_BYTES, BASE_NONE, NULL, 0x00,
3478 "Cell Broadcast Message - Service Group", HFILL
3482 /* Setup protocol subtree array */
3483 static gint *ett[] = {
3491 DebugLog(("Registering SMPP dissector\n"));
3492 /* Register the protocol name and description */
3493 proto_smpp = proto_register_protocol("Short Message Peer to Peer",
3496 /* Required function calls to register header fields and subtrees used */
3497 proto_register_field_array(proto_smpp, hf, array_length(hf));
3498 proto_register_subtree_array(ett, array_length(ett));
3500 /* Allow other dissectors to find this one by name. */
3501 register_dissector("smpp", dissect_smpp, proto_smpp);
3503 /* Register for tapping */
3504 smpp_tap = register_tap("smpp");
3507 smpp_module = prefs_register_protocol (proto_smpp, NULL);
3508 prefs_register_bool_preference (smpp_module,
3509 "reassemble_smpp_over_tcp",
3510 "Reassemble SMPP over TCP messages spanning multiple TCP segments",
3511 "Whether the SMPP dissector should reassemble messages spanning multiple TCP segments."
3512 " To use this option, you must also enable "
3513 "\"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
3514 &reassemble_over_tcp);
3518 * If dissector uses sub-dissector registration add a registration routine.
3519 * This format is required because a script is used to find these routines and
3520 * create the code that calls these routines.
3523 proto_reg_handoff_smpp(void)
3525 dissector_handle_t smpp_handle;
3528 * SMPP can be spoken on any port under TCP or X.25
3529 * ...how *do* we do that under X.25?
3531 * We can register the heuristic SMPP dissector with X.25, for one
3532 * thing. We don't currently have any mechanism to allow the user
3533 * to specify that a given X.25 circuit is to be dissected as SMPP,
3536 smpp_handle = find_dissector("smpp");
3537 dissector_add_handle("tcp.port", smpp_handle);
3538 heur_dissector_add("tcp", dissect_smpp_heur, proto_smpp);
3539 heur_dissector_add("x.25", dissect_smpp_heur, proto_smpp);
3541 /* Required for call_dissector() */
3542 DebugLog(("Finding gsm-sms-ud subdissector\n"));
3543 gsm_sms_handle = find_dissector("gsm-sms-ud");
3544 DISSECTOR_ASSERT(gsm_sms_handle);
3547 stats_tree_register_with_group("smpp","smpp_commands", st_str_smpp,
3548 smpp_stats_tree_per_packet, smpp_stats_tree_init,
3549 NULL, REGISTER_STAT_GROUP_TELEPHONY);