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 * Value-arrays for field-contents
270 static const value_string vals_command_id[] = { /* Operation */
271 { 0x80000000, "Generic_nack" },
272 { 0x00000001, "Bind_receiver" },
273 { 0x80000001, "Bind_receiver - resp" },
274 { 0x00000002, "Bind_transmitter" },
275 { 0x80000002, "Bind_transmitter - resp" },
276 { 0x00000003, "Query_sm" },
277 { 0x80000003, "Query_sm - resp" },
278 { 0x00000004, "Submit_sm" },
279 { 0x80000004, "Submit_sm - resp" },
280 { 0x00000005, "Deliver_sm" },
281 { 0x80000005, "Deliver_sm - resp" },
282 { 0x00000006, "Unbind" },
283 { 0x80000006, "Unbind - resp" },
284 { 0x00000007, "Replace_sm" },
285 { 0x80000007, "Replace_sm - resp" },
286 { 0x00000008, "Cancel_sm" },
287 { 0x80000008, "Cancel_sm - resp" },
288 { 0x00000009, "Bind_transceiver" },
289 { 0x80000009, "Bind_transceiver - resp" },
290 { 0x0000000B, "Outbind" },
291 { 0x00000015, "Enquire_link" },
292 { 0x80000015, "Enquire_link - resp" },
293 { 0x00000021, "Submit_multi" },
294 { 0x80000021, "Submit_multi - resp" },
295 { 0x00000102, "Alert_notification" },
296 { 0x00000103, "Data_sm" },
297 { 0x80000103, "Data_sm - resp" },
298 /* Introduced in SMPP 5.0 */
299 { 0x00000111, "Broadcast_sm" },
300 { 0x80000111, "Broadcast_sm - resp" },
301 { 0x00000112, "Query_broadcast_sm" },
302 { 0x80000112, "Query_broadcast_sm - resp" },
303 { 0x00000113, "Cancel_broadcast_sm" },
304 { 0x80000113, "Cancel_broadcast_sm - resp" },
308 static const value_string vals_command_status[] = { /* Status */
309 { 0x00000000, "Ok" },
310 { 0x00000001, "Message length is invalid" },
311 { 0x00000002, "Command length is invalid" },
312 { 0x00000003, "Invalid command ID" },
313 { 0x00000004, "Incorrect BIND status for given command" },
314 { 0x00000005, "ESME already in bound state" },
315 { 0x00000006, "Invalid priority flag" },
316 { 0x00000007, "Invalid registered delivery flag" },
317 { 0x00000008, "System error" },
318 { 0x00000009, "[Reserved]" },
319 { 0x0000000A, "Invalid source address" },
320 { 0x0000000B, "Invalid destination address" },
321 { 0x0000000C, "Message ID is invalid" },
322 { 0x0000000D, "Bind failed" },
323 { 0x0000000E, "Invalid password" },
324 { 0x0000000F, "Invalid system ID" },
325 { 0x00000010, "[Reserved]" },
326 { 0x00000011, "Cancel SM failed" },
327 { 0x00000012, "[Reserved]" },
328 { 0x00000013, "Replace SM failed" },
329 { 0x00000014, "Message queue full" },
330 { 0x00000015, "Invalid service type" },
331 { 0x00000033, "Invalid number of destinations" },
332 { 0x00000034, "Invalid distribution list name" },
333 { 0x00000040, "Destination flag is invalid (submit_multi)" },
334 { 0x00000041, "[Reserved]" },
335 { 0x00000042, "Invalid 'submit with replace' request" },
336 { 0x00000043, "Invalid esm_class field data" },
337 { 0x00000044, "Cannot submit to distribution list" },
338 { 0x00000045, "submit_sm or submit_multi failed" },
339 { 0x00000046, "[Reserved]" },
340 { 0x00000047, "[Reserved]" },
341 { 0x00000048, "Invalid source address TON" },
342 { 0x00000049, "Invalid source address NPI" },
343 { 0x00000050, "Invalid destination address TON" },
344 { 0x00000051, "Invalid destination address NPI" },
345 { 0x00000052, "[Reserved]" },
346 { 0x00000053, "Invalid system_type field" },
347 { 0x00000054, "Invalid replace_if_present flag" },
348 { 0x00000055, "Invalid number of messages" },
349 { 0x00000056, "[Reserved]" },
350 { 0x00000057, "[Reserved]" },
351 { 0x00000058, "Throttling error (ESME exceeded allowed message limits)" },
352 { 0x00000059, "[Reserved]" },
353 { 0x00000060, "[Reserved]" },
354 { 0x00000061, "Invalid scheduled delivery time" },
355 { 0x00000062, "Invalid message validity period (expiry time)" },
356 { 0x00000063, "Predefined message invalid or not found" },
357 { 0x00000064, "ESME receiver temporary app error code" },
358 { 0x00000065, "ESME receiver permanent app error code" },
359 { 0x00000066, "ESME receiver reject message error code" },
360 { 0x00000067, "query_sm request failed" },
361 { 0x000000C0, "Error in the optional part of the PDU body" },
362 { 0x000000C1, "Optional parameter not allowed" },
363 { 0x000000C2, "Invalid parameter length" },
364 { 0x000000C3, "Expected optional parameter missing" },
365 { 0x000000C4, "Invalid optional parameter value" },
366 { 0x000000FE, "(Transaction) Delivery failure (used for data_sm_resp)" },
367 { 0x000000FF, "Unknown error" },
368 /* Introduced in SMPP 5.0 */
369 { 0x00000100, "ESME Not authorised to use specified service_type." },
370 { 0x00000101, "ESME Prohibited from using specified operation."},
371 { 0x00000102, "Specified service_type is unavailable." },
372 { 0x00000103, "Specified service_type is denied." },
373 { 0x00000104, "Invalid Data Coding Scheme." },
374 { 0x00000105, "Source Address Sub unit is Invalid." },
375 { 0x00000106, "Destination Address Sub unit is Invalid." },
376 { 0x00000107, "Broadcast Frequency Interval is invalid." },
377 { 0x00000108, "Broadcast Alias Name is invalid." },
378 { 0x00000109, "Broadcast Area Format is invalid." },
379 { 0x0000010A, "Number of Broadcast Areas is invalid." },
380 { 0x0000010B, "Broadcast Content Type is invalid." },
381 { 0x0000010C, "Broadcast Message Class is invalid." },
382 { 0x0000010D, "broadcast_sm operation failed." },
383 { 0x0000010E, "query_broadcast_sm operation failed." },
384 { 0x0000010F, "cancel_broadcast_sm operation failed." },
385 { 0x00000110, "Number of Repeated Broadcasts is invalid." },
386 { 0x00000111, "Broadcast Service Group is invalid." },
387 { 0x00000112, "Broadcast Channel Indicator is invalid." },
391 static const value_string vals_tlv_tags[] = {
392 { 0x0005, "dest_addr_subunit" },
393 { 0x0006, "dest_network_type" },
394 { 0x0007, "dest_bearer_type" },
395 { 0x0008, "dest_telematics_id" },
396 { 0x000D, "source_addr_subunit" },
397 { 0x000E, "source_network_type" },
398 { 0x000F, "source_bearer_type" },
399 { 0x0010, "source_telematics_id" },
400 { 0x0017, "qos_time_to_live" },
401 { 0x0019, "payload_type" },
402 { 0x001D, "additional_status_info_text" },
403 { 0x001E, "receipted_message_id" },
404 { 0x0030, "ms_msg_wait_facilities" },
405 { 0x0201, "privacy_indicator" },
406 { 0x0202, "source_subaddress" },
407 { 0x0203, "dest_subaddress" },
408 { 0x0204, "user_message_reference" },
409 { 0x0205, "user_response_code" },
410 { 0x020A, "source_port" },
411 { 0x020B, "dest_port" },
412 { 0x020C, "sar_msg_ref_num" },
413 { 0x020D, "language_indicator" },
414 { 0x020E, "sar_total_segments" },
415 { 0x020F, "sar_segment_seqnum" },
416 { 0x0210, "sc_interface_version" },
417 { 0x0302, "callback_num_pres_ind" },
418 { 0x0303, "callback_num_atag" },
419 { 0x0304, "number_of_messages" },
420 { 0x0381, "callback_num" },
421 { 0x0420, "dpf_result" },
422 { 0x0421, "set_dpf" },
423 { 0x0422, "ms_availability_status" },
424 { 0x0423, "network_error_code" },
425 { 0x0424, "message_payload" },
426 { 0x0425, "delivery_failure_reason" },
427 { 0x0426, "more_messages_to_send" },
428 { 0x0427, "message_state" },
429 { 0x0428, "congestion_state" },
430 { 0x0501, "ussd_service_op" },
431 { 0x0600, "broadcast_channel_indicator" },
432 { 0x0601, "broadcast_content_type" },
433 { 0x0602, "broadcast_content_type_info" },
434 { 0x0603, "broadcast_message_class" },
435 { 0x0604, "broadcast_rep_num" },
436 { 0x0605, "broadcast_frequency_interval" },
437 { 0x0606, "broadcast_area_identifier" },
438 { 0x0607, "broadcast_error_status" },
439 { 0x0608, "broadcast_area_success" },
440 { 0x0609, "broadcast_end_time" },
441 { 0x060A, "broadcast_service_group" },
442 { 0x060B, "billing_identification" },
443 { 0x060D, "source_network_id" },
444 { 0x060E, "dest_network_id" },
445 { 0x060F, "source_node_id" },
446 { 0x0610, "dest_node_id" },
447 { 0x0611, "dest_addr_np_resolution" },
448 { 0x0612, "dest_addr_np_information" },
449 { 0x0613, "dest_addr_np_country" },
450 { 0x1201, "display_time" },
451 { 0x1203, "sms_signal" },
452 { 0x1204, "ms_validity" },
453 { 0x130C, "alert_on_message_delivery" },
454 { 0x1380, "its_reply_type" },
455 { 0x1383, "its_session_info" },
459 static const value_string vals_addr_ton[] = {
461 { 1, "International" },
463 { 3, "Network specific" },
464 { 4, "Subscriber number" },
465 { 5, "Alphanumeric" },
466 { 6, "Abbreviated" },
470 static const value_string vals_addr_npi[] = {
472 { 1, "ISDN (E163/E164)" },
473 { 3, "Data (X.121)" },
474 { 4, "Telex (F.69)" },
475 { 6, "Land mobile (E.212)" },
479 { 14, "Internet (IP)" },
480 { 18, "WAP client Id" },
484 static const value_string vals_esm_submit_msg_mode[] = {
485 { 0x0, "Default SMSC mode" },
486 { 0x1, "Datagram mode" },
487 { 0x2, "Forward mode" },
488 { 0x3, "Store and forward mode" },
492 static const value_string vals_esm_submit_msg_type[] = {
493 { 0x0, "Default message type" },
494 { 0x1, "Short message contains SMSC Delivery Receipt" },
495 { 0x2, "Short message contains (E)SME delivery acknowledgement" },
497 { 0x4, "Short message contains (E)SME manual/user acknowledgement" },
499 { 0x6, "Short message contains conversation abort" },
501 { 0x8, "Short message contains intermediate delivery notification" },
505 static const value_string vals_esm_submit_features[] = {
506 { 0x0, "No specific features selected" },
507 { 0x1, "UDHI indicator" },
508 { 0x2, "Reply path" },
509 { 0x3, "UDHI and reply path" },
513 static const value_string vals_priority_flag[] = {
514 { 0, "GSM: None ANSI-136: Bulk IS-95: Normal" },
515 { 1, "GSM: priority ANSI-136: Normal IS-95: Interactive" },
516 { 2, "GSM: priority ANSI-136: Urgent IS-95: Urgent" },
517 { 3, "GSM: priority ANSI-136: Very Urgent IS-95: Emergency" },
521 static const value_string vals_regdel_receipt[] = {
522 { 0x0, "No SMSC delivery receipt requested" },
523 { 0x1, "Delivery receipt requested (for success or failure)" },
524 { 0x2, "Delivery receipt requested (for failure)" },
525 { 0x3, "Reserved in version <= 3.4; Delivery receipt requested (for success) in 5.0" },
529 static const value_string vals_regdel_acks[] = {
530 { 0x0, "No recipient SME acknowledgement requested" },
531 { 0x1, "SME delivery acknowledgement requested" },
532 { 0x2, "SME manual/user acknowledgement requested" },
533 { 0x3, "Both delivery and manual/user acknowledgement requested" },
537 static const value_string vals_regdel_notif[] = {
538 { 0x0, "No intermediate notification requested" },
539 { 0x1, "Intermediate notification requested" },
543 static const value_string vals_replace_if_present_flag[] = {
544 { 0x0, "Don't replace" },
549 static const value_string vals_data_coding[] = {
550 { 0, "SMSC default alphabet" },
551 { 1, "IA5 (CCITT T.50/ASCII (ANSI X3.4)" },
552 { 2, "Octet unspecified (8-bit binary)" },
553 { 3, "Latin 1 (ISO-8859-1)" },
554 { 4, "Octet unspecified (8-bit binary)" },
555 { 5, "JIS (X 0208-1990)" },
556 { 6, "Cyrillic (ISO-8859-5)" },
557 { 7, "Latin/Hebrew (ISO-8859-8)" },
558 { 8, "UCS2 (ISO/IEC-10646)" },
559 { 9, "Pictogram encoding" },
560 { 10, "ISO-2022-JP (Music codes)" },
563 { 13, "Extended Kanji JIS(X 0212-1990)" },
565 /*! \TODO Rest to be defined (bitmask?) according GSM 03.38 */
569 static const value_string vals_message_state[] = {
574 { 5, "UNDELIVERABLE" },
581 static const value_string vals_addr_subunit[] = {
582 { 0, "Unknown -default-" },
584 { 2, "Mobile equipment" },
585 { 3, "Smart card 1" },
586 { 4, "External unit 1" },
590 static const value_string vals_network_type[] = {
593 { 2, "ANSI-136/TDMA" },
599 { 8, "Paging network" },
603 static const value_string vals_bearer_type[] = {
606 { 2, "Circuit Switched Data (CSD)" },
607 { 3, "Packet data" },
611 { 7, "FLEX/ReFLEX" },
612 { 8, "Cell Broadcast" },
616 static const value_string vals_payload_type[] = {
618 { 1, "WCMP message" },
622 static const value_string vals_privacy_indicator[] = {
623 { 0, "Not restricted -default-" },
625 { 2, "Confidential" },
630 static const value_string vals_language_indicator[] = {
631 { 0, "Unspecified -default-" },
640 static const value_string vals_display_time[] = {
642 { 1, "Default -default-" },
647 static const value_string vals_ms_validity[] = {
648 { 0, "Store indefinitely -default-" },
650 { 2, "SID based registration area" },
651 { 3, "Display only" },
655 static const value_string vals_dpf_result[] = {
656 { 0, "DPF not set" },
661 static const value_string vals_set_dpf[] = {
662 { 0, "Not requested (Set DPF for delivery failure)" },
663 { 1, "Requested (Set DPF for delivery failure)" },
667 static const value_string vals_ms_availability_status[] = {
668 { 0, "Available -default-" },
670 { 2, "Unavailable" },
674 static const value_string vals_delivery_failure_reason[] = {
675 { 0, "Destination unavailable" },
676 { 1, "Destination address invalid" },
677 { 2, "Permanent network error" },
678 { 3, "Temporary network error" },
682 static const value_string vals_more_messages_to_send[] = {
683 { 0, "No more messages" },
684 { 1, "More messages -default-" },
688 static const value_string vals_its_reply_type[] = {
691 { 2, "Telephone no." },
693 { 4, "Character line" },
701 static const value_string vals_ussd_service_op[] = {
702 { 0, "PSSD indication" },
703 { 1, "PSSR indication" },
704 { 2, "USSR request" },
705 { 3, "USSN request" },
706 { 16, "PSSD response" },
707 { 17, "PSSR response" },
708 { 18, "USSR confirm" },
709 { 19, "USSN confirm" },
713 static const value_string vals_msg_wait_ind[] = {
714 { 0, "Set indication inactive" },
715 { 1, "Set indication active" },
719 static const value_string vals_msg_wait_type[] = {
720 { 0, "Voicemail message waiting" },
721 { 1, "Fax message waiting" },
722 { 2, "Electronic mail message waiting" },
723 { 3, "Other message waiting" },
727 static const value_string vals_callback_num_pres[] = {
728 { 0, "Presentation allowed" },
729 { 1, "Presentation restricted" },
730 { 2, "Number not available" },
735 static const value_string vals_callback_num_scrn[] = {
736 { 0, "User provided, not screened" },
737 { 1, "User provided, verified and passed" },
738 { 2, "User provided, verified and failed" },
739 { 3, "Network provided" },
743 static const value_string vals_network_error_type[] = {
744 { 1, "ANSI-136 (Access Denied Reason)" },
745 { 2, "IS-95 (Access Denied Reason)" },
747 { 4, "[Reserved] in <= 3.4; ANSI 136 Cause Code in 5.0" },
748 { 5, "[Reserved] in <= 3.4; IS 95 Cause Code in 5.0" },
749 { 6, "[Reserved] in <= 3.4; ANSI-41 Error in 5.0" },
750 { 7, "[Reserved] in <= 3.4; SMPP Error in 5.0" },
751 { 8, "[Reserved] in <= 3.4; Message Center Specific in 5.0" },
755 static const value_string vals_its_session_ind[] = {
756 { 0, "End of session indicator inactive" },
757 { 1, "End of session indicator active" },
761 /* Data Coding Scheme: see 3GPP TS 23.040 and 3GPP TS 23.038 */
762 static const value_string vals_dcs_sms_coding_group[] = {
763 { 0x00, "SMS DCS: General Data Coding indication - Uncompressed text, no message class" },
764 { 0x01, "SMS DCS: General Data Coding indication - Uncompressed text" },
765 { 0x02, "SMS DCS: General Data Coding indication - Compressed text, no message class" },
766 { 0x03, "SMS DCS: General Data Coding indication - Compressed text" },
767 { 0x04, "SMS DCS: Message Marked for Automatic Deletion - Uncompressed text, no message class" },
768 { 0x05, "SMS DCS: Message Marked for Automatic Deletion - Uncompressed text" },
769 { 0x06, "SMS DCS: Message Marked for Automatic Deletion - Compressed text, no message class" },
770 { 0x07, "SMS DCS: Message Marked for Automatic Deletion - Compressed text" },
771 { 0x08, "SMS DCS: Reserved" },
772 { 0x09, "SMS DCS: Reserved" },
773 { 0x0A, "SMS DCS: Reserved" },
774 { 0x0B, "SMS DCS: Reserved" },
775 { 0x0C, "SMS DCS: Message Waiting Indication - Discard Message" },
776 { 0x0D, "SMS DCS: Message Waiting Indication - Store Message (GSM 7-bit default alphabet)" },
777 { 0x0E, "SMS DCS: Message Waiting Indication - Store Message (UCS-2 character set)" },
778 { 0x0F, "SMS DCS: Data coding / message class" },
782 static const true_false_string tfs_dcs_text_compression = {
787 static const true_false_string tfs_dcs_class_present = {
788 "Message class is present",
792 static const value_string vals_dcs_charset[] = {
793 { 0x00, "GSM 7-bit default alphabet" },
794 { 0x01, "8-bit data" },
795 { 0x02, "UCS-2 (16-bit) data" },
796 { 0x03, "Reserved" },
800 static const value_string vals_dcs_class[] = {
802 { 0x01, "Class 1 - ME specific" },
803 { 0x02, "Class 2 - (U)SIM specific" },
804 { 0x03, "Class 3 - TE specific" },
808 static const value_string vals_dcs_cbs_coding_group[] = {
809 { 0x00, "CBS DCS: Language using the GSM 7-bit default alphabet" },
810 { 0x01, "CBS DCS: Language indication at beginning of message" },
811 { 0x02, "CBS DCS: Language using the GSM 7-bit default alphabet" },
812 { 0x03, "CBS DCS: Reserved" },
813 { 0x04, "CBS DCS: General Data Coding indication - Uncompressed text, no message class" },
814 { 0x05, "CBS DCS: General Data Coding indication - Uncompressed text" },
815 { 0x06, "CBS DCS: General Data Coding indication - Compressed text, no message class" },
816 { 0x07, "CBS DCS: General Data Coding indication - Compressed text" },
817 { 0x08, "CBS DCS: Reserved" },
818 { 0x09, "CBS DCS: Message with User Data Header structure" },
819 { 0x0A, "CBS DCS: Reserved" },
820 { 0x0B, "CBS DCS: Reserved" },
821 { 0x0C, "CBS DCS: Reserved" },
822 { 0x0D, "CBS DCS: Reserved" },
823 { 0x0E, "CBS DCS: Defined by the WAP Forum" },
824 { 0x0F, "SMS DCS: Data coding / message class" },
828 static const value_string vals_dcs_cbs_language[] = {
837 { 0x08, "Portuguese" },
839 { 0x0A, "Norwegian" },
842 { 0x0D, "Hungarian" },
844 { 0x0F, "Language not specified" },
845 { 0x10, "GSM 7-bit default alphabet - message preceded by language indication" },
846 { 0x11, "UCS-2 (16-bit) - message preceded by language indication" },
851 { 0x24, "Icelandic" },
855 static const value_string vals_dcs_cbs_class[] = {
856 { 0x00, "No message class" },
857 { 0x01, "Class 1 - User defined" },
858 { 0x02, "Class 2 - User defined" },
859 { 0x03, "Class 3 - TE specific" },
863 static const value_string vals_dcs_wap_class[] = {
864 { 0x00, "No message class" },
865 { 0x01, "Class 1 - ME specific" },
866 { 0x02, "Class 2 - (U)SIM specific" },
867 { 0x03, "Class 3 - TE specific" },
871 static const value_string vals_dcs_wap_charset[] = {
872 { 0x00, "Reserved" },
873 { 0x01, "8-bit data" },
874 { 0x02, "Reserved" },
875 { 0x03, "Reserved" },
879 static const value_string vals_alert_on_message_delivery[] = {
880 { 0x00, "Use mobile default alert (Default)" },
881 { 0x01, "Use low-priority alert" },
882 { 0x02, "Use medium-priority alert" },
883 { 0x03, "Use high-priority alert" },
887 static const range_string vals_congestion_state[] = {
890 {30, 49, "Medium Load"},
891 {50, 79, "High Load"},
892 {80, 89, "Optimum Load"}, /*Specs says 80-90, but that is probably a mistake */
893 {90, 99, "Nearing Congestion"},
894 {100, 100, "Congested / Maximum Load"},
898 static const range_string vals_broadcast_channel_indicator[] = {
899 {0, 0, "Basic Broadcast Channel (Default)"},
900 {1, 1, "Extended Broadcast Channel"},
901 {2, 255, "[Reserved]"},
905 static const value_string vals_broadcast_message_class[] = {
906 {0, "No Class Specified (default)"},
907 {1, "Class 1 (User Defined)"},
908 {2, "Class 2 (User Defined)"},
909 {3, "Class 3 (Terminal Equipment)"},
913 static const range_string vals_broadcast_area_success[] = {
915 {101, 254, "[Reserved]"},
916 {255, 255, "Information not available"},
920 static const value_string vals_broadcast_content_type_nw[] = {
923 {2, "TDMA [IS824][ANSI-41]"},
924 {3, "CDMA [IS824][IS637]"},
928 static const value_string vals_broadcast_content_type_type[] = {
929 {0x0000, "[System Service] Index"},
930 {0x0001, "[System Service] Emergency Broadcasts"},
931 {0x0002, "[System Service] IRDB Download"},
932 {0x0010, "[News Service] News Flashes"},
933 {0x0011, "[News Service] General News (Local)"},
934 {0x0012, "[News Service] General News (Regional)"},
935 {0x0013, "[News Service] General News (National)"},
936 {0x0014, "[News Service] General News (Internationa)"},
937 {0x0015, "[News Service] Business/Financial News (Local)"},
938 {0x0016, "[News Service] Business/Financial News (Regional)"},
939 {0x0017, "[News Service] Business/Financial News (National)"},
940 {0x0018, "[News Service] Business/Financial News (International)"},
941 {0x0019, "[News Service] Sports News (Local)"},
942 {0x001A, "[News Service] Sports News (Regional)"},
943 {0x001B, "[News Service] Sports News (National)"},
944 {0x001C, "[News Service] Sports News (International)"},
945 {0x001D, "[News Service] Entertainment News (Local)"},
946 {0x001E, "[News Service] Entertainment News (Regional)"},
947 {0x001F, "[News Service] Entertainment News (National)"},
948 {0x0020, "[News Service] Entertainment News (International)"},
949 {0x0021, "[Subscriber Information Services] Medical/Health/Hospitals"},
950 {0x0022, "[Subscriber Information Services] Doctors"},
951 {0x0023, "[Subscriber Information Services] Pharmacy"},
952 {0x0030, "[Subscriber Information Services] Local Traffic/Road Reports"},
953 {0x0031, "[Subscriber Information Services] Long Distance Traffic/Road Reports"},
954 {0x0032, "[Subscriber Information Services] Taxis"},
955 {0x0033, "[Subscriber Information Services] Weather"},
956 {0x0034, "[Subscriber Information Services] Local Airport Flight Schedules"},
957 {0x0035, "[Subscriber Information Services] Restaurants"},
958 {0x0036, "[Subscriber Information Services] Lodgings"},
959 {0x0037, "[Subscriber Information Services] Retail Directory"},
960 {0x0038, "[Subscriber Information Services] Advertisements"},
961 {0x0039, "[Subscriber Information Services] Stock Quotes"},
962 {0x0040, "[Subscriber Information Services] Employment Opportunities"},
963 {0x0041, "[Subscriber Information Services] Technology News"},
964 {0x0070, "[Carrier Information Services] District (Base Station Info)"},
965 {0x0071, "[Carrier Information Services] Network Information"},
966 {0x0080, "[Subscriber Care Services] Operator Services"},
967 {0x0081, "[Subscriber Care Services] Directory Enquiries (National)"},
968 {0x0082, "[Subscriber Care Services] Directory Enquiries (International)"},
969 {0x0083, "[Subscriber Care Services] Customer Care (National)"},
970 {0x0084, "[Subscriber Care Services] Customer Care (International)"},
971 {0x0085, "[Subscriber Care Services] Local Date/Time/Time Zone"},
972 {0x0100, "[Multi Category Services] Multi Category Services"},
976 static const value_string vals_broadcast_frequency_interval_unit[] = {
977 {0x00, "As frequently as possible"},
988 static const value_string vals_dest_addr_np_resolution[] = {
989 {0x00, "query has not been performed (default)"},
990 {0x01, "query has been performed, number not ported"},
991 {0x02, "query has been performed, number ported"},
995 static const range_string vals_broadcast_area_identifier_format[] = {
996 {0, 0, "Alias / Name"},
997 {1, 1, "Ellipsoid Arc"},
999 {3, 255, "[Reserved]"},
1003 static dissector_handle_t gsm_sms_handle;
1009 smpp_stats_tree_init(stats_tree* st)
1011 st_smpp_ops = stats_tree_create_node(st, "SMPP Operations", 0, TRUE);
1012 st_smpp_req = stats_tree_create_node(st, "SMPP Requests", st_smpp_ops, TRUE);
1013 st_smpp_res = stats_tree_create_node(st, "SMPP Responses", st_smpp_ops, TRUE);
1014 st_smpp_res_status = stats_tree_create_node(st, "SMPP Response Status", 0, TRUE);
1019 smpp_stats_tree_per_packet(stats_tree *st, /* st as it was passed to us */
1020 packet_info *pinfo _U_,
1021 epan_dissect_t *edt _U_,
1022 const void *p) /* Used for getting SMPP command_id values */
1024 smpp_tap_rec_t* tap_rec = (smpp_tap_rec_t*)p;
1026 tick_stat_node(st, "SMPP Operations", 0, TRUE);
1028 if ((tap_rec->command_id & 0x80000000) == 0x80000000) /* Response */
1030 tick_stat_node(st, "SMPP Responses", st_smpp_ops, TRUE);
1031 tick_stat_node(st, val_to_str(tap_rec->command_id, vals_command_id, "Unknown 0x%08x"), st_smpp_res, FALSE);
1033 tick_stat_node(st, "SMPP Response Status", 0, TRUE);
1034 tick_stat_node(st, val_to_str(tap_rec->command_status, vals_command_status, "Unknown 0x%08x"), st_smpp_res_status, FALSE);
1039 tick_stat_node(st, "SMPP Requests", st_smpp_ops, TRUE);
1040 tick_stat_node(st, val_to_str(tap_rec->command_id, vals_command_id, "Unknown 0x%08x"), st_smpp_req, FALSE);
1047 * SMPP equivalent of mktime() (3). Convert date to standard 'time_t' format
1049 * \param datestr The SMPP-formatted date to convert
1050 * \param secs Returns the 'time_t' equivalent
1051 * \param nsecs Returns the additional nano-seconds
1053 * \return Whether time is specified relative or absolute
1054 * \retval TRUE Relative time
1055 * \retval FALSE Absolute time
1058 smpp_mktime(const char *datestr, time_t *secs, int *nsecs)
1062 gboolean relative = (datestr[15] == 'R') ? TRUE : FALSE;
1064 r_time.tm_year = 10 * (datestr[0] - '0') + (datestr[1] - '0');
1066 * Y2K rollover date as recommended in appendix C
1068 if (r_time.tm_year < 38)
1069 r_time.tm_year += 100;
1070 r_time.tm_mon = 10 * (datestr[2] - '0') + (datestr[3] - '0');
1072 r_time.tm_mday = 10 * (datestr[4] - '0') + (datestr[5] - '0');
1073 r_time.tm_hour = 10 * (datestr[6] - '0') + (datestr[7] - '0');
1074 r_time.tm_min = 10 * (datestr[8] - '0') + (datestr[9] - '0');
1075 r_time.tm_sec = 10 * (datestr[10] - '0') + (datestr[11] - '0');
1076 r_time.tm_isdst = -1;
1078 if (relative == FALSE) {
1079 *secs = mktime(&r_time);
1080 *nsecs = (datestr[12] - '0') * 100000000;
1081 t_diff = (10 * (datestr[13] - '0') + (datestr[14] - '0')) * 900;
1082 if (datestr[15] == '+')
1084 else if (datestr[15] == '-')
1087 *secs = r_time.tm_sec + 60 *
1088 (r_time.tm_min + 60 *
1089 (r_time.tm_hour + 24 *
1098 * Scanning routines to add standard types (byte, int, string...) to the
1101 * \param tree The protocol tree to add to
1102 * \param tvb Buffer containing the data
1103 * \param field Actual field whose value needs displaying
1104 * \param offset Location of field in buffer, returns location of
1108 smpp_handle_string(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
1112 len = tvb_strsize(tvb, *offset);
1114 proto_tree_add_string(tree, field, tvb, *offset, len,
1115 (const char *) tvb_get_ptr(tvb, *offset, len));
1120 /* NOTE - caller must free the returned string! */
1122 smpp_handle_string_return(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
1127 len = tvb_strsize(tvb, *offset);
1129 str = (char *)tvb_get_ephemeral_stringz(tvb, *offset, &len);
1130 proto_tree_add_string(tree, field, tvb, *offset, len, str);
1139 smpp_handle_string_z(proto_tree *tree, tvbuff_t *tvb, int field, int *offset,
1140 const char *null_string)
1144 len = tvb_strsize(tvb, *offset);
1146 proto_tree_add_string(tree, field, tvb, *offset, len,
1147 (const char *)tvb_get_ptr(tvb, *offset, len));
1149 proto_tree_add_string(tree, field, tvb, *offset, len, null_string);
1155 smpp_handle_int1(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
1159 val = tvb_get_guint8(tvb, *offset);
1160 proto_tree_add_uint(tree, field, tvb, *offset, 1, val);
1165 smpp_handle_int2(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
1169 val = tvb_get_ntohs(tvb, *offset);
1170 proto_tree_add_uint(tree, field, tvb, *offset, 2, val);
1175 smpp_handle_int4(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
1179 val = tvb_get_ntohl(tvb, *offset);
1180 proto_tree_add_uint(tree, field, tvb, *offset, 4, val);
1185 smpp_handle_time(proto_tree *tree, tvbuff_t *tvb,
1186 int field, int field_R, int *offset)
1192 strval = (char *) tvb_get_ephemeral_stringz(tvb, *offset, &len);
1197 if (smpp_mktime(strval, &tmptime.secs, &tmptime.nsecs))
1198 proto_tree_add_time(tree, field_R, tvb, *offset, len, &tmptime);
1200 proto_tree_add_time(tree, field, tvb, *offset, len, &tmptime);
1204 proto_tree_add_text(tree, tvb, *offset, len, "Invalid time: %s", strval);
1211 * Scanning routine to handle the destination-list of 'submit_multi'
1213 * \param tree The protocol tree to add to
1214 * \param tvb Buffer containing the data
1215 * \param offset Location of field in buffer, returns location of
1219 smpp_handle_dlist(proto_tree *tree, tvbuff_t *tvb, int *offset)
1222 int tmpoff = *offset;
1223 proto_item *sub_tree = NULL;
1226 if ((entries = tvb_get_guint8(tvb, tmpoff++)))
1228 sub_tree = proto_tree_add_item(tree, hf_smpp_dlist,
1229 tvb, *offset, 1, FALSE);
1230 proto_item_add_subtree(sub_tree, ett_dlist);
1234 dest_flag = tvb_get_guint8(tvb, tmpoff++);
1235 if (dest_flag == 1) /* SME address */
1237 smpp_handle_int1(sub_tree, tvb, hf_smpp_dest_addr_ton, &tmpoff);
1238 smpp_handle_int1(sub_tree, tvb, hf_smpp_dest_addr_npi, &tmpoff);
1239 smpp_handle_string(sub_tree,tvb,hf_smpp_destination_addr,&tmpoff);
1241 else /* Distribution list */
1243 smpp_handle_string(sub_tree, tvb, hf_smpp_dl_name, &tmpoff);
1250 * Scanning routine to handle the destination result list
1251 * of 'submit_multi_resp'
1253 * \param tree The protocol tree to add to
1254 * \param tvb Buffer containing the data
1255 * \param offset Location of field in buffer, returns location of
1259 smpp_handle_dlist_resp(proto_tree *tree, tvbuff_t *tvb, int *offset)
1262 int tmpoff = *offset;
1263 proto_item *sub_tree = NULL;
1265 if ((entries = tvb_get_guint8(tvb, tmpoff++)))
1267 sub_tree = proto_tree_add_item(tree, hf_smpp_dlist_resp,
1268 tvb, *offset, 1, FALSE);
1269 proto_item_add_subtree(sub_tree, ett_dlist_resp);
1273 smpp_handle_int1(sub_tree, tvb, hf_smpp_dest_addr_ton, &tmpoff);
1274 smpp_handle_int1(sub_tree, tvb, hf_smpp_dest_addr_npi, &tmpoff);
1275 smpp_handle_string(sub_tree,tvb,hf_smpp_destination_addr,&tmpoff);
1276 smpp_handle_int4(sub_tree, tvb, hf_smpp_error_status_code, &tmpoff);
1282 * Scanning routine to handle all optional parameters of SMPP-operations.
1283 * The parameters have the format Tag Length Value (TLV), with a 2-byte tag
1284 * and 2-byte length.
1286 * \param tree The protocol tree to add to
1287 * \param tvb Buffer containing the data
1288 * \param offset Location of field in buffer, returns location of
1292 smpp_handle_tlv(proto_tree *tree, tvbuff_t *tvb, int *offset)
1294 proto_item *tlvs_tree = NULL;
1296 if (tvb_reported_length_remaining(tvb, *offset) >= 1)
1298 tlvs_tree = proto_tree_add_item(tree, hf_smpp_opt_params,
1299 tvb, *offset, -1, FALSE);
1300 proto_item_add_subtree(tlvs_tree, ett_opt_params);
1303 while (tvb_reported_length_remaining(tvb, *offset) >= 1)
1305 proto_item *sub_tree;
1311 guint8 major, minor;
1314 tag = tvb_get_ntohs(tvb, *offset);
1315 length = tvb_get_ntohs(tvb, (*offset+2));
1317 sub_tree = proto_tree_add_none_format(tlvs_tree, hf_smpp_opt_param,
1318 tvb, *offset, length+4,
1319 "Optional parameter: %s (0x%04x)",
1320 val_to_str(tag, vals_tlv_tags, "0x%04x"), tag);
1321 proto_item_add_subtree(sub_tree, ett_opt_param);
1322 proto_tree_add_uint(sub_tree,hf_smpp_opt_param_tag,tvb,*offset,2,tag);
1323 proto_tree_add_uint(sub_tree,hf_smpp_opt_param_len,tvb,*offset+2,2,length);
1328 case 0x0005: /* dest_addr_subunit */
1329 smpp_handle_int1(sub_tree, tvb,
1330 hf_smpp_dest_addr_subunit, offset);
1332 case 0x0006: /* dest_network_type */
1333 smpp_handle_int1(sub_tree, tvb,
1334 hf_smpp_dest_network_type, offset);
1336 case 0x0007: /* dest_bearer_type */
1337 smpp_handle_int1(sub_tree, tvb,
1338 hf_smpp_dest_bearer_type, offset);
1340 case 0x0008: /* dest_telematics_id */
1341 smpp_handle_int2(sub_tree, tvb,
1342 hf_smpp_dest_telematics_id, offset);
1344 case 0x000D: /* source_addr_subunit */
1345 smpp_handle_int1(sub_tree, tvb,
1346 hf_smpp_source_addr_subunit, offset);
1348 case 0x000E: /* source_network_type */
1349 smpp_handle_int1(sub_tree, tvb,
1350 hf_smpp_source_network_type, offset);
1352 case 0x000F: /* source_bearer_type */
1353 smpp_handle_int1(sub_tree, tvb,
1354 hf_smpp_source_bearer_type, offset);
1356 case 0x0010: /* source_telematics_id */
1357 smpp_handle_int2(sub_tree, tvb,
1358 hf_smpp_source_telematics_id, offset);
1360 case 0x0017: /* qos_time_to_live */
1361 smpp_handle_int4(sub_tree, tvb,
1362 hf_smpp_qos_time_to_live, offset);
1364 case 0x0019: /* payload_type */
1365 smpp_handle_int1(sub_tree, tvb,
1366 hf_smpp_payload_type, offset);
1368 case 0x001D: /* additional_status_info_text */
1369 smpp_handle_string(sub_tree, tvb,
1370 hf_smpp_additional_status_info_text, offset);
1372 case 0x001E: /* receipted_message_id */
1373 smpp_handle_string(sub_tree, tvb,
1374 hf_smpp_receipted_message_id, offset);
1376 case 0x0030: /* ms_msg_wait_facilities */
1377 field = tvb_get_guint8(tvb, *offset);
1378 proto_tree_add_item(sub_tree, hf_smpp_msg_wait_ind,
1379 tvb, *offset, 1, field);
1380 proto_tree_add_item(sub_tree, hf_smpp_msg_wait_type,
1381 tvb, *offset, 1, field);
1384 case 0x0201: /* privacy_indicator */
1385 smpp_handle_int1(sub_tree, tvb,
1386 hf_smpp_privacy_indicator, offset);
1388 case 0x0202: /* source_subaddress */
1390 proto_tree_add_item(sub_tree, hf_smpp_source_subaddress,
1391 tvb, *offset, length, FALSE);
1392 (*offset) += length;
1395 case 0x0203: /* dest_subaddress */
1397 proto_tree_add_item(sub_tree, hf_smpp_dest_subaddress,
1398 tvb, *offset, length, FALSE);
1399 (*offset) += length;
1402 case 0x0204: /* user_message_reference */
1403 smpp_handle_int2(sub_tree, tvb,
1404 hf_smpp_user_message_reference, offset);
1406 case 0x0205: /* user_response_code */
1407 smpp_handle_int1(sub_tree, tvb,
1408 hf_smpp_user_response_code, offset);
1410 case 0x020A: /* source_port */
1411 smpp_handle_int2(sub_tree, tvb,
1412 hf_smpp_source_port, offset);
1414 case 0x020B: /* destination_port */
1415 smpp_handle_int2(sub_tree, tvb,
1416 hf_smpp_destination_port, offset);
1418 case 0x020C: /* sar_msg_ref_num */
1419 smpp_handle_int2(sub_tree, tvb,
1420 hf_smpp_sar_msg_ref_num, offset);
1422 case 0x020D: /* language_indicator */
1423 smpp_handle_int1(sub_tree, tvb,
1424 hf_smpp_language_indicator, offset);
1426 case 0x020E: /* sar_total_segments */
1427 smpp_handle_int1(sub_tree, tvb,
1428 hf_smpp_sar_total_segments, offset);
1430 case 0x020F: /* sar_segment_seqnum */
1431 smpp_handle_int1(sub_tree, tvb,
1432 hf_smpp_sar_segment_seqnum, offset);
1434 case 0x0210: /* SC_interface_version */
1435 field = tvb_get_guint8(tvb, *offset);
1436 minor = field & 0x0F;
1437 major = (field & 0xF0) >> 4;
1438 strval=ep_alloc(BUFSIZ);
1439 g_snprintf(strval, BUFSIZ, "%u.%u", major, minor);
1440 proto_tree_add_string(sub_tree, hf_smpp_SC_interface_version,
1441 tvb, *offset, 1, strval);
1444 case 0x0302: /* callback_num_pres_ind */
1445 field = tvb_get_guint8(tvb, *offset);
1446 proto_tree_add_item(sub_tree, hf_smpp_callback_num_pres,
1447 tvb, *offset, 1, field);
1448 proto_tree_add_item(sub_tree, hf_smpp_callback_num_scrn,
1449 tvb, *offset, 1, field);
1452 case 0x0303: /* callback_num_atag */
1454 proto_tree_add_item(sub_tree, hf_smpp_callback_num_atag,
1455 tvb, *offset, length, FALSE);
1456 (*offset) += length;
1458 case 0x0304: /* number_of_messages */
1459 smpp_handle_int1(sub_tree, tvb,
1460 hf_smpp_number_of_messages, offset);
1462 case 0x0381: /* callback_num */
1464 proto_tree_add_item(sub_tree, hf_smpp_callback_num,
1465 tvb, *offset, length, FALSE);
1466 (*offset) += length;
1468 case 0x0420: /* dpf_result */
1469 smpp_handle_int1(sub_tree, tvb,
1470 hf_smpp_dpf_result, offset);
1472 case 0x0421: /* set_dpf */
1473 smpp_handle_int1(sub_tree, tvb,
1474 hf_smpp_set_dpf, offset);
1476 case 0x0422: /* ms_availability_status */
1477 smpp_handle_int1(sub_tree, tvb,
1478 hf_smpp_ms_availability_status, offset);
1480 case 0x0423: /* network_error_code */
1481 smpp_handle_int1(sub_tree, tvb,
1482 hf_smpp_network_error_type, offset);
1483 smpp_handle_int2(sub_tree, tvb,
1484 hf_smpp_network_error_code, offset);
1486 case 0x0424: /* message_payload */
1488 proto_tree_add_item(sub_tree, hf_smpp_message_payload,
1489 tvb, *offset, length, FALSE);
1490 (*offset) += length;
1492 case 0x0425: /* delivery_failure_reason */
1493 smpp_handle_int1(sub_tree, tvb,
1494 hf_smpp_delivery_failure_reason, offset);
1496 case 0x0426: /* more_messages_to_send */
1497 smpp_handle_int1(sub_tree, tvb,
1498 hf_smpp_more_messages_to_send, offset);
1500 case 0x0427: /* message_state */
1501 smpp_handle_int1(sub_tree, tvb,
1502 hf_smpp_message_state, offset);
1504 case 0x0428: /* congestion_state */
1505 smpp_handle_int1(sub_tree, tvb,
1506 hf_smpp_congestion_state, offset);
1509 case 0x0501: /* ussd_service_op */
1510 smpp_handle_int1(sub_tree, tvb,
1511 hf_smpp_ussd_service_op, offset);
1513 case 0x0600: /* broadcast_channel_indicator */
1514 smpp_handle_int1(sub_tree, tvb,
1515 hf_smpp_broadcast_channel_indicator, offset);
1517 case 0x0601: /* broadcast_content_type */
1518 field = tvb_get_guint8(tvb, *offset);
1519 proto_tree_add_uint(sub_tree, hf_smpp_broadcast_content_type_nw, tvb, *offset, 1, field);
1521 field16 = tvb_get_ntohs(tvb, *offset);
1522 proto_tree_add_uint(sub_tree, hf_smpp_broadcast_content_type_type, tvb, *offset, 2, field16);
1525 case 0x0602: /* broadcast_content_type_info */
1527 proto_tree_add_item(sub_tree, hf_smpp_broadcast_content_type_info,
1528 tvb, *offset, length, FALSE);
1529 (*offset) += length;
1531 case 0x0603: /* broadcast_message_class */
1532 smpp_handle_int1(sub_tree, tvb,
1533 hf_smpp_broadcast_message_class, offset);
1535 case 0x0604: /* broadcast_rep_num */
1536 smpp_handle_int1(sub_tree, tvb,
1537 hf_smpp_broadcast_rep_num, offset);
1539 case 0x0605: /* broadcast_frequency_interval */
1540 field = tvb_get_guint8(tvb, *offset);
1541 proto_tree_add_uint(sub_tree, hf_smpp_broadcast_frequency_interval_unit, tvb, *offset, 1, field);
1543 field16 = tvb_get_ntohs(tvb, *offset);
1544 proto_tree_add_uint(sub_tree, hf_smpp_broadcast_frequency_interval_value, tvb, *offset, 2, field16);
1547 case 0x0606: /* broadcast_area_identifier */
1548 field = tvb_get_guint8(tvb, *offset);
1549 proto_tree_add_uint(sub_tree, hf_smpp_broadcast_area_identifier_format, tvb, *offset, 1, field);
1550 proto_tree_add_item(sub_tree, hf_smpp_broadcast_area_identifier,
1551 tvb, *offset, length, FALSE);
1552 (*offset) += length;
1554 case 0x0607: /* broadcast_error_status */
1555 smpp_handle_int4(sub_tree, tvb,
1556 hf_smpp_broadcast_error_status, offset);
1558 case 0x0608: /* broadcast_area_success */
1559 smpp_handle_int1(sub_tree, tvb,
1560 hf_smpp_broadcast_area_success, offset);
1562 case 0x0609: /* broadcast_end_time */
1563 smpp_handle_time(sub_tree, tvb, hf_smpp_broadcast_end_time,
1564 hf_smpp_broadcast_end_time_r, offset);
1566 case 0x060A: /* broadcast_service_group */
1568 proto_tree_add_item(sub_tree, hf_smpp_broadcast_service_group,
1569 tvb, *offset, length, FALSE);
1570 (*offset) += length;
1572 case 0x060B: /* billing_identification */
1574 proto_tree_add_item(sub_tree, hf_smpp_billing_identification,
1575 tvb, *offset, length, FALSE);
1576 (*offset) += length;
1578 /* 0x060C is skipped in the specs for some reason :-? */
1579 case 0x060D: /* source_network_id */
1580 smpp_handle_string_z(sub_tree, tvb, hf_smpp_source_network_id,
1583 case 0x060E: /* dest_network_id */
1584 smpp_handle_string_z(sub_tree, tvb, hf_smpp_dest_network_id,
1587 case 0x060F: /* source_node_id */
1589 proto_tree_add_item(sub_tree, hf_smpp_source_node_id,
1590 tvb, *offset, length, FALSE);
1591 (*offset) += length;
1593 case 0x0610: /* dest_node_id */
1595 proto_tree_add_item(sub_tree, hf_smpp_dest_node_id,
1596 tvb, *offset, length, FALSE);
1597 (*offset) += length;
1599 case 0x0611: /* dest_addr_np_resolution */
1600 smpp_handle_int1(sub_tree, tvb,
1601 hf_smpp_dest_addr_np_resolution, offset);
1603 case 0x0612: /* dest_addr_np_information */
1605 proto_tree_add_item(sub_tree, hf_smpp_dest_addr_np_information,
1606 tvb, *offset, length, FALSE);
1607 (*offset) += length;
1609 case 0x0613: /* dest_addr_np_country */
1610 /* TODO : Fetch values from packet-e164? */
1612 proto_tree_add_item(sub_tree, hf_smpp_dest_addr_np_country,
1613 tvb, *offset, length, FALSE);
1614 (*offset) += length;
1616 case 0x1201: /* display_time */
1617 smpp_handle_int1(sub_tree, tvb,
1618 hf_smpp_display_time, offset);
1620 case 0x1203: /* sms_signal */
1621 smpp_handle_int2(sub_tree, tvb,
1622 hf_smpp_sms_signal, offset);
1623 /*! \todo Fill as per TIA/EIA-136-710-A */
1625 case 0x1204: /* ms_validity */
1626 smpp_handle_int1(sub_tree, tvb,
1627 hf_smpp_ms_validity, offset);
1629 case 0x130C: /* alert_on_message_delivery */
1631 proto_tree_add_item(sub_tree,
1632 hf_smpp_alert_on_message_delivery_null,
1633 tvb, *offset, length, FALSE);
1635 smpp_handle_int1(sub_tree, tvb,
1636 hf_smpp_alert_on_message_delivery, offset);
1639 case 0x1380: /* its_reply_type */
1640 smpp_handle_int1(sub_tree, tvb,
1641 hf_smpp_its_reply_type, offset);
1643 case 0x1383: /* its_session_info */
1644 smpp_handle_int1(sub_tree, tvb,
1645 hf_smpp_its_session_number, offset);
1646 field = tvb_get_guint8(tvb, *offset);
1647 proto_tree_add_item(sub_tree, hf_smpp_its_session_sequence,
1648 tvb, *offset, 1, field);
1649 proto_tree_add_item(sub_tree, hf_smpp_its_session_ind,
1650 tvb, *offset, 1, field);
1655 /* TODO : Hopefully to be implemented soon - handle vendor specific TLVs
1656 * from a dictionary before treating them as unknown! */
1657 if ((tag >= 0x1400) && (tag <= 0x3FFF)) {
1658 proto_tree_add_item(sub_tree, hf_smpp_vendor_op, tvb,
1659 *offset, length, FALSE);
1661 proto_tree_add_item(sub_tree, hf_smpp_reserved_op, tvb,
1662 *offset, length, FALSE);
1665 proto_item_append_text(sub_tree,": %s", tvb_bytes_to_str(tvb,*offset,length));
1666 (*offset) += length;
1673 smpp_handle_dcs(proto_tree *tree, tvbuff_t *tvb, int *offset)
1677 proto_item *subtree = NULL;
1679 val = tvb_get_guint8(tvb, off);
1680 subtree = proto_tree_add_uint(tree,
1681 hf_smpp_data_coding, tvb, off, 1, val);
1682 proto_item_add_subtree(subtree, ett_dcs);
1683 /* SMPP Data Coding Scheme */
1684 proto_tree_add_uint(subtree, hf_smpp_dcs, tvb, off, 1, val);
1685 /* GSM SMS Data Coding Scheme */
1686 proto_tree_add_text(subtree, tvb, off, 1,
1687 "GSM SMS Data Coding");
1688 proto_tree_add_uint(subtree,
1689 hf_smpp_dcs_sms_coding_group, tvb, off, 1, val);
1690 if (val>>6 == 2) { /* Reserved */
1692 } else if (val < 0xF0) {
1693 proto_tree_add_boolean(subtree,
1694 hf_smpp_dcs_text_compression, tvb, off, 1, val);
1695 proto_tree_add_boolean(subtree,
1696 hf_smpp_dcs_class_present, tvb, off, 1, val);
1697 proto_tree_add_uint(subtree,
1698 hf_smpp_dcs_charset, tvb, off, 1, val);
1700 proto_tree_add_uint(subtree,
1701 hf_smpp_dcs_class, tvb, off, 1, val);
1704 proto_tree_add_text(subtree, tvb, off, 1,
1705 "SMPP: Bit .... 1... should be 0 (reserved)");
1706 proto_tree_add_uint(subtree,
1707 hf_smpp_dcs_charset, tvb, off, 1, val);
1708 proto_tree_add_uint(subtree,
1709 hf_smpp_dcs_class, tvb, off, 1, val);
1711 /* Cell Broadcast Service (CBS) Data Coding Scheme */
1712 proto_tree_add_text(subtree, tvb, off, 1,
1713 "GSM CBS Data Coding");
1714 proto_tree_add_uint(subtree,
1715 hf_smpp_dcs_cbs_coding_group, tvb, off, 1, val);
1716 if (val < 0x40) { /* Language specified */
1717 proto_tree_add_uint(subtree,
1718 hf_smpp_dcs_cbs_language, tvb, off, 1, val);
1719 } else if (val>>6 == 1) { /* General Data Coding indication */
1720 proto_tree_add_boolean(subtree,
1721 hf_smpp_dcs_text_compression, tvb, off, 1, val);
1722 proto_tree_add_boolean(subtree,
1723 hf_smpp_dcs_class_present, tvb, off, 1, val);
1724 proto_tree_add_uint(subtree,
1725 hf_smpp_dcs_charset, tvb, off, 1, val);
1727 proto_tree_add_uint(subtree,
1728 hf_smpp_dcs_class, tvb, off, 1, val);
1729 } else if (val>>6 == 2) { /* Message with UDH structure */
1730 proto_tree_add_uint(subtree,
1731 hf_smpp_dcs_charset, tvb, off, 1, val);
1732 proto_tree_add_uint(subtree,
1733 hf_smpp_dcs_class, tvb, off, 1, val);
1734 } else if (val>>4 == 14) { /* WAP Forum */
1735 proto_tree_add_uint(subtree,
1736 hf_smpp_dcs_wap_charset, tvb, off, 1, val);
1737 proto_tree_add_uint(subtree,
1738 hf_smpp_dcs_wap_class, tvb, off, 1, val);
1739 } else if (val>>4 == 15) { /* Data coding / message handling */
1741 proto_tree_add_text(subtree, tvb, off, 1,
1742 "SMPP: Bit .... 1... should be 0 (reserved)");
1743 proto_tree_add_uint(subtree,
1744 hf_smpp_dcs_charset, tvb, off, 1, val);
1745 proto_tree_add_uint(subtree,
1746 hf_smpp_dcs_cbs_class, tvb, off, 1, val);
1753 * The next set of routines handle the different operations, associated
1757 bind_receiver(proto_tree *tree, tvbuff_t *tvb)
1761 guint8 major, minor;
1764 strval=ep_alloc(BUFSIZ);
1765 smpp_handle_string(tree, tvb, hf_smpp_system_id, &offset);
1766 smpp_handle_string(tree, tvb, hf_smpp_password, &offset);
1767 smpp_handle_string(tree, tvb, hf_smpp_system_type, &offset);
1768 field = tvb_get_guint8(tvb, offset++);
1769 minor = field & 0x0F;
1770 major = (field & 0xF0) >> 4;
1771 g_snprintf(strval, BUFSIZ, "%u.%u", major, minor);
1772 proto_tree_add_string(tree, hf_smpp_interface_version, tvb,
1773 offset - 1, 1, strval);
1774 smpp_handle_int1(tree, tvb, hf_smpp_addr_ton, &offset);
1775 smpp_handle_int1(tree, tvb, hf_smpp_addr_npi, &offset);
1776 smpp_handle_string(tree, tvb, hf_smpp_address_range, &offset);
1779 #define bind_transmitter(a, b) bind_receiver(a, b)
1782 query_sm(proto_tree *tree, tvbuff_t *tvb)
1786 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
1787 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_ton, &offset);
1788 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_npi, &offset);
1789 smpp_handle_string(tree, tvb, hf_smpp_source_addr, &offset);
1792 #define bind_transceiver(a, b) bind_receiver(a, b)
1795 outbind(proto_tree *tree, tvbuff_t *tvb)
1799 smpp_handle_string(tree, tvb, hf_smpp_system_id, &offset);
1800 smpp_handle_string(tree, tvb, hf_smpp_password, &offset);
1804 submit_sm(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
1805 proto_tree *top_tree)
1811 char *src_str = NULL;
1812 char *dst_str = NULL;
1813 address save_src, save_dst;
1815 smpp_handle_string_z(tree, tvb, hf_smpp_service_type, &offset, "(Default)");
1816 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_ton, &offset);
1817 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_npi, &offset);
1818 src_str = smpp_handle_string_return(tree, tvb, hf_smpp_source_addr, &offset);
1819 smpp_handle_int1(tree, tvb, hf_smpp_dest_addr_ton, &offset);
1820 smpp_handle_int1(tree, tvb, hf_smpp_dest_addr_npi, &offset);
1821 dst_str = smpp_handle_string_return(tree, tvb, hf_smpp_destination_addr, &offset);
1822 flag = tvb_get_guint8(tvb, offset);
1824 proto_tree_add_item(tree, hf_smpp_esm_submit_msg_mode,
1825 tvb, offset, 1, flag);
1826 proto_tree_add_item(tree, hf_smpp_esm_submit_msg_type,
1827 tvb, offset, 1, flag);
1828 proto_tree_add_item(tree, hf_smpp_esm_submit_features,
1829 tvb, offset, 1, flag);
1831 smpp_handle_int1(tree, tvb, hf_smpp_protocol_id, &offset);
1832 smpp_handle_int1(tree, tvb, hf_smpp_priority_flag, &offset);
1833 if (tvb_get_guint8(tvb,offset)) {
1834 smpp_handle_time(tree, tvb, hf_smpp_schedule_delivery_time,
1835 hf_smpp_schedule_delivery_time_r, &offset);
1836 } else { /* Time = NULL means Immediate delivery */
1837 proto_tree_add_text(tree, tvb, offset++, 1,
1838 "Scheduled delivery time: Immediate delivery");
1840 if (tvb_get_guint8(tvb,offset)) {
1841 smpp_handle_time(tree, tvb, hf_smpp_validity_period,
1842 hf_smpp_validity_period_r, &offset);
1843 } else { /* Time = NULL means SMSC default validity */
1844 proto_tree_add_text(tree, tvb, offset++, 1,
1845 "Validity period: SMSC default validity period");
1847 flag = tvb_get_guint8(tvb, offset);
1848 proto_tree_add_item(tree, hf_smpp_regdel_receipt, tvb, offset, 1, flag);
1849 proto_tree_add_item(tree, hf_smpp_regdel_acks, tvb, offset, 1, flag);
1850 proto_tree_add_item(tree, hf_smpp_regdel_notif, tvb, offset, 1, flag);
1852 smpp_handle_int1(tree, tvb, hf_smpp_replace_if_present_flag, &offset);
1853 smpp_handle_dcs(tree, tvb, &offset);
1854 smpp_handle_int1(tree, tvb, hf_smpp_sm_default_msg_id, &offset);
1855 length = tvb_get_guint8(tvb, offset);
1856 proto_tree_add_uint(tree, hf_smpp_sm_length, tvb, offset++, 1, length);
1859 proto_tree_add_item(tree, hf_smpp_short_message,
1860 tvb, offset, length, FALSE);
1861 if (udhi) /* UDHI indicator present */
1863 DebugLog(("UDHI present - set addresses\n"));
1864 /* Save original addresses */
1865 SET_ADDRESS(&save_src, pinfo->src.type, pinfo->src.len, pinfo->src.data);
1866 SET_ADDRESS(&save_dst, pinfo->dst.type, pinfo->dst.len, pinfo->dst.data);
1867 /* Set SMPP source and destination address */
1868 SET_ADDRESS(&(pinfo->src), AT_STRINGZ, 1+(int)strlen(src_str), src_str);
1869 SET_ADDRESS(&(pinfo->dst), AT_STRINGZ, 1+(int)strlen(dst_str), dst_str);
1870 tvb_msg = tvb_new_subset (tvb, offset,
1871 MIN(length, tvb_reported_length(tvb) - offset), length);
1872 call_dissector (gsm_sms_handle, tvb_msg, pinfo, top_tree);
1873 /* Restore original addresses */
1874 SET_ADDRESS(&(pinfo->src), save_src.type, save_src.len, save_src.data );
1875 SET_ADDRESS(&(pinfo->dst), save_dst.type, save_dst.len, save_dst.data);
1879 /* Get rid of SMPP text string addresses */
1880 smpp_handle_tlv(tree, tvb, &offset);
1883 #define deliver_sm(a, b, c, d) submit_sm(a, b, c, d)
1886 replace_sm(proto_tree *tree, tvbuff_t *tvb)
1892 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
1893 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_ton, &offset);
1894 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_npi, &offset);
1895 smpp_handle_string(tree, tvb, hf_smpp_source_addr, &offset);
1896 if (tvb_get_guint8(tvb,offset)) {
1897 smpp_handle_time(tree, tvb, hf_smpp_schedule_delivery_time,
1898 hf_smpp_schedule_delivery_time_r, &offset);
1899 } else { /* Time = NULL */
1900 proto_tree_add_text(tree, tvb, offset++, 1,
1901 "Scheduled delivery time: Keep initial delivery time setting");
1903 if (tvb_get_guint8(tvb,offset)) {
1904 smpp_handle_time(tree, tvb, hf_smpp_validity_period,
1905 hf_smpp_validity_period_r, &offset);
1906 } else { /* Time = NULL */
1907 proto_tree_add_text(tree, tvb, offset++, 1,
1908 "Validity period: Keep initial validity period setting");
1910 flag = tvb_get_guint8(tvb, offset);
1911 proto_tree_add_item(tree, hf_smpp_regdel_receipt, tvb, offset, 1, flag);
1912 proto_tree_add_item(tree, hf_smpp_regdel_acks, tvb, offset, 1, flag);
1913 proto_tree_add_item(tree, hf_smpp_regdel_notif, tvb, offset, 1, flag);
1915 smpp_handle_int1(tree, tvb, hf_smpp_sm_default_msg_id, &offset);
1916 length = tvb_get_guint8(tvb, offset);
1917 proto_tree_add_uint(tree, hf_smpp_sm_length, tvb, offset++, 1, length);
1919 proto_tree_add_item(tree, hf_smpp_short_message,
1920 tvb, offset, length, FALSE);
1925 cancel_sm(proto_tree *tree, tvbuff_t *tvb)
1929 smpp_handle_string_z(tree, tvb, hf_smpp_service_type, &offset, "(Default)");
1930 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
1931 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_ton, &offset);
1932 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_npi, &offset);
1933 smpp_handle_string(tree, tvb, hf_smpp_source_addr, &offset);
1934 smpp_handle_int1(tree, tvb, hf_smpp_dest_addr_ton, &offset);
1935 smpp_handle_int1(tree, tvb, hf_smpp_dest_addr_npi, &offset);
1936 smpp_handle_string(tree, tvb, hf_smpp_destination_addr, &offset);
1940 submit_multi(proto_tree *tree, tvbuff_t *tvb)
1946 smpp_handle_string_z(tree, tvb, hf_smpp_service_type, &offset, "(Default)");
1947 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_ton, &offset);
1948 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_npi, &offset);
1949 smpp_handle_string(tree, tvb, hf_smpp_source_addr, &offset);
1951 smpp_handle_dlist(tree, tvb, &offset);
1953 flag = tvb_get_guint8(tvb, offset);
1954 proto_tree_add_item(tree, hf_smpp_esm_submit_msg_mode,
1955 tvb, offset, 1, flag);
1956 proto_tree_add_item(tree, hf_smpp_esm_submit_msg_type,
1957 tvb, offset, 1, flag);
1958 proto_tree_add_item(tree, hf_smpp_esm_submit_features,
1959 tvb, offset, 1, flag);
1961 smpp_handle_int1(tree, tvb, hf_smpp_protocol_id, &offset);
1962 smpp_handle_int1(tree, tvb, hf_smpp_priority_flag, &offset);
1963 if (tvb_get_guint8(tvb,offset)) {
1964 smpp_handle_time(tree, tvb, hf_smpp_schedule_delivery_time,
1965 hf_smpp_schedule_delivery_time_r, &offset);
1966 } else { /* Time = NULL means Immediate delivery */
1967 proto_tree_add_text(tree, tvb, offset++, 1,
1968 "Scheduled delivery time: Immediate delivery");
1970 if (tvb_get_guint8(tvb,offset)) {
1971 smpp_handle_time(tree, tvb, hf_smpp_validity_period,
1972 hf_smpp_validity_period_r, &offset);
1973 } else { /* Time = NULL means SMSC default validity */
1974 proto_tree_add_text(tree, tvb, offset++, 1,
1975 "Validity period: SMSC default validity period");
1977 flag = tvb_get_guint8(tvb, offset);
1978 proto_tree_add_item(tree, hf_smpp_regdel_receipt, tvb, offset, 1, flag);
1979 proto_tree_add_item(tree, hf_smpp_regdel_acks, tvb, offset, 1, flag);
1980 proto_tree_add_item(tree, hf_smpp_regdel_notif, tvb, offset, 1, flag);
1982 smpp_handle_int1(tree, tvb, hf_smpp_replace_if_present_flag, &offset);
1983 smpp_handle_dcs(tree, tvb, &offset);
1984 smpp_handle_int1(tree, tvb, hf_smpp_sm_default_msg_id, &offset);
1985 length = tvb_get_guint8(tvb, offset);
1986 proto_tree_add_uint(tree, hf_smpp_sm_length, tvb, offset++, 1, length);
1988 proto_tree_add_item(tree, hf_smpp_short_message,
1989 tvb, offset, length, FALSE);
1991 smpp_handle_tlv(tree, tvb, &offset);
1995 alert_notification(proto_tree *tree, tvbuff_t *tvb)
1999 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_ton, &offset);
2000 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_npi, &offset);
2001 smpp_handle_string(tree, tvb, hf_smpp_source_addr, &offset);
2002 smpp_handle_int1(tree, tvb, hf_smpp_esme_addr_ton, &offset);
2003 smpp_handle_int1(tree, tvb, hf_smpp_esme_addr_npi, &offset);
2004 smpp_handle_string(tree, tvb, hf_smpp_esme_addr, &offset);
2005 smpp_handle_tlv(tree, tvb, &offset);
2009 data_sm(proto_tree *tree, tvbuff_t *tvb)
2014 smpp_handle_string_z(tree, tvb, hf_smpp_service_type, &offset, "(Default)");
2015 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_ton, &offset);
2016 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_npi, &offset);
2017 smpp_handle_string(tree, tvb, hf_smpp_source_addr, &offset);
2018 smpp_handle_int1(tree, tvb, hf_smpp_dest_addr_ton, &offset);
2019 smpp_handle_int1(tree, tvb, hf_smpp_dest_addr_npi, &offset);
2020 smpp_handle_string(tree, tvb, hf_smpp_destination_addr, &offset);
2021 flag = tvb_get_guint8(tvb, offset);
2022 proto_tree_add_item(tree, hf_smpp_esm_submit_msg_mode,
2023 tvb, offset, 1, flag);
2024 proto_tree_add_item(tree, hf_smpp_esm_submit_msg_type,
2025 tvb, offset, 1, flag);
2026 proto_tree_add_item(tree, hf_smpp_esm_submit_features,
2027 tvb, offset, 1, flag);
2029 flag = tvb_get_guint8(tvb, offset);
2030 proto_tree_add_item(tree, hf_smpp_regdel_receipt, tvb, offset, 1, flag);
2031 proto_tree_add_item(tree, hf_smpp_regdel_acks, tvb, offset, 1, flag);
2032 proto_tree_add_item(tree, hf_smpp_regdel_notif, tvb, offset, 1, flag);
2034 smpp_handle_dcs(tree, tvb, &offset);
2035 smpp_handle_tlv(tree, tvb, &offset);
2039 * Request operations introduced in the SMPP 5.0
2042 broadcast_sm(proto_tree *tree, tvbuff_t *tvb)
2046 smpp_handle_string_z(tree, tvb, hf_smpp_service_type, &offset, "(Default)");
2047 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_ton, &offset);
2048 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_npi, &offset);
2049 smpp_handle_string(tree, tvb, hf_smpp_source_addr, &offset);
2050 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
2051 smpp_handle_int1(tree, tvb, hf_smpp_priority_flag, &offset);
2052 if (tvb_get_guint8(tvb,offset)) {
2053 smpp_handle_time(tree, tvb, hf_smpp_schedule_delivery_time,
2054 hf_smpp_schedule_delivery_time_r, &offset);
2055 } else { /* Time = NULL means Immediate delivery */
2056 proto_tree_add_text(tree, tvb, offset++, 1,
2057 "Scheduled delivery time: Immediate delivery");
2059 if (tvb_get_guint8(tvb,offset)) {
2060 smpp_handle_time(tree, tvb, hf_smpp_validity_period,
2061 hf_smpp_validity_period_r, &offset);
2062 } else { /* Time = NULL means SMSC default validity */
2063 proto_tree_add_text(tree, tvb, offset++, 1,
2064 "Validity period: SMSC default validity period");
2066 smpp_handle_int1(tree, tvb, hf_smpp_replace_if_present_flag, &offset);
2067 smpp_handle_dcs(tree, tvb, &offset);
2068 smpp_handle_int1(tree, tvb, hf_smpp_sm_default_msg_id, &offset);
2069 smpp_handle_tlv(tree, tvb, &offset);
2073 query_broadcast_sm(proto_tree *tree, tvbuff_t *tvb)
2077 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
2078 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_ton, &offset);
2079 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_npi, &offset);
2080 smpp_handle_string(tree, tvb, hf_smpp_source_addr, &offset);
2081 smpp_handle_tlv(tree, tvb, &offset);
2085 cancel_broadcast_sm(proto_tree *tree, tvbuff_t *tvb)
2089 smpp_handle_string_z(tree, tvb, hf_smpp_service_type, &offset, "(Default)");
2090 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
2091 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_ton, &offset);
2092 smpp_handle_int1(tree, tvb, hf_smpp_source_addr_npi, &offset);
2093 smpp_handle_string(tree, tvb, hf_smpp_source_addr, &offset);
2094 smpp_handle_tlv(tree, tvb, &offset);
2098 * The next set of routines handle the different operation-responses,
2099 * associated with SMPP.
2102 bind_receiver_resp(proto_tree *tree, tvbuff_t *tvb)
2106 smpp_handle_string(tree, tvb, hf_smpp_system_id, &offset);
2107 smpp_handle_tlv(tree, tvb, &offset);
2110 #define bind_transmitter_resp(a, b) bind_receiver_resp(a, b)
2113 query_sm_resp(proto_tree *tree, tvbuff_t *tvb)
2117 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
2118 smpp_handle_time(tree, tvb, hf_smpp_final_date,
2119 hf_smpp_final_date_r, &offset);
2120 smpp_handle_int1(tree, tvb, hf_smpp_message_state, &offset);
2121 smpp_handle_int1(tree, tvb, hf_smpp_error_code, &offset);
2124 #define bind_transceiver_resp(a, b) bind_receiver_resp(a, b)
2127 submit_sm_resp(proto_tree *tree, tvbuff_t *tvb)
2131 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
2132 smpp_handle_tlv(tree, tvb, &offset);
2135 #define deliver_sm_resp(a, b) submit_sm_resp(a, b)
2138 submit_multi_resp(proto_tree *tree, tvbuff_t *tvb)
2142 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
2143 smpp_handle_dlist_resp(tree, tvb, &offset);
2144 smpp_handle_tlv(tree, tvb, &offset);
2148 data_sm_resp(proto_tree *tree, tvbuff_t *tvb)
2152 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
2153 smpp_handle_tlv(tree, tvb, &offset);
2156 #define broadcast_sm_resp(a, b) submit_sm_resp(a, b)
2159 query_broadcast_sm_resp(proto_tree *tree, tvbuff_t *tvb)
2163 smpp_handle_string(tree, tvb, hf_smpp_message_id, &offset);
2164 smpp_handle_tlv(tree, tvb, &offset);
2169 * A 'heuristic dissector' that attemtps to establish whether we have
2170 * a genuine SMPP PDU here.
2172 * at least the fixed header is there
2173 * it has a correct overall PDU length
2174 * it is a 'well-known' operation
2175 * has a 'well-known' status
2178 dissect_smpp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2180 guint command_id; /* SMPP command */
2181 guint command_status; /* Status code */
2182 guint command_length; /* length of PDU */
2184 if (tvb_reported_length(tvb) < SMPP_MIN_LENGTH) /* Mandatory header */
2186 command_length = tvb_get_ntohl(tvb, 0);
2187 if (command_length > 64 * 1024 || command_length < SMPP_MIN_LENGTH)
2189 command_id = tvb_get_ntohl(tvb, 4); /* Only known commands */
2190 if (match_strval(command_id, vals_command_id) == NULL)
2192 command_status = tvb_get_ntohl(tvb, 8); /* ..with known status */
2193 if (match_strval(command_status, vals_command_status) == NULL)
2195 dissect_smpp(tvb, pinfo, tree);
2200 get_smpp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
2202 return tvb_get_ntohl(tvb, offset);
2206 * This global SMPP variable is used to determine whether the PDU to dissect
2207 * is the first SMPP PDU in the packet (or reassembled buffer), requiring
2208 * different column update code than subsequent SMPP PDUs within this packet
2209 * (or reassembled buffer).
2211 * FIXME - This approach is NOT dissection multi-thread safe!
2213 static gboolean first = TRUE;
2216 dissect_smpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2219 if (pinfo->ptype == PT_TCP) { /* are we running on top of TCP */
2220 tcp_dissect_pdus(tvb, pinfo, tree,
2221 reassemble_over_tcp, /* Do we try to reassemble */
2222 16, /* Length of fixed header */
2223 get_smpp_pdu_len, /* Function returning PDU len */
2224 dissect_smpp_pdu); /* PDU dissector */
2225 } else { /* no? probably X.25 */
2227 while (tvb_reported_length_remaining(tvb, offset) > 0) {
2228 guint16 pdu_len = tvb_get_ntohl(tvb, offset);
2229 gint pdu_real_len = tvb_length_remaining(tvb, offset);
2233 THROW(ReportedBoundsError);
2235 if (pdu_real_len <= 0)
2237 if (pdu_real_len > pdu_len)
2238 pdu_real_len = pdu_len;
2239 pdu_tvb = tvb_new_subset(tvb, offset, pdu_real_len, pdu_len);
2240 dissect_smpp_pdu(pdu_tvb, pinfo, tree);
2248 /* Dissect a single SMPP PDU contained within "tvb". */
2250 dissect_smpp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2252 int offset = 0; /* Offset within tvbuff */
2253 guint command_length; /* length of PDU */
2254 guint command_id; /* SMPP command */
2255 guint command_status; /* Status code */
2256 guint sequence_number; /* ...of command */
2257 smpp_tap_rec_t* tap_rec; /* Tap record */
2258 const gchar *command_str;
2259 const gchar *command_status_str = NULL;
2260 /* Set up structures needed to add the protocol subtree and manage it */
2261 proto_item *ti = NULL;
2262 proto_tree *smpp_tree = NULL;
2265 * Safety: don't even try to dissect the PDU
2266 * when the mandatory header isn't present.
2268 if (tvb_reported_length(tvb) < SMPP_MIN_LENGTH)
2270 command_length = tvb_get_ntohl(tvb, offset);
2272 command_id = tvb_get_ntohl(tvb, offset);
2273 command_str = val_to_str(command_id, vals_command_id,
2274 "(Unknown SMPP Operation 0x%08X)");
2276 command_status = tvb_get_ntohl(tvb, offset);
2277 if (command_id & 0x80000000) {
2278 command_status_str = val_to_str(command_status, vals_command_status,
2279 "(Reserved Error 0x%08X)");
2282 sequence_number = tvb_get_ntohl(tvb, offset);
2286 * Update the protocol column.
2288 if (first == TRUE) {
2289 col_set_str(pinfo->cinfo, COL_PROTOCOL, "SMPP");
2293 * Create display subtree for the protocol
2296 ti = proto_tree_add_item (tree, proto_smpp, tvb, 0, tvb->length, FALSE);
2297 smpp_tree = proto_item_add_subtree (ti, ett_smpp);
2301 * Cycle over the encapsulated PDUs
2307 * Make entries in the Info column on the summary display
2309 if (check_col(pinfo->cinfo, COL_INFO)) {
2310 if (first == TRUE) {
2312 * First PDU - We already computed the fixed header
2314 col_clear(pinfo->cinfo, COL_INFO);
2315 col_add_fstr(pinfo->cinfo, COL_INFO, "SMPP %s", command_str);
2321 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", command_str);
2324 * Display command status of responses in Info column
2326 if (command_id & 0x80000000) {
2327 col_append_fstr(pinfo->cinfo, COL_INFO, ": \"%s\"",
2328 command_status_str);
2333 * Create a tvb for the current PDU.
2334 * Physical length: at most command_length
2335 * Reported length: command_length
2337 if (tvb_length_remaining(tvb, offset - 16 + command_length) > 0) {
2338 pdu_tvb = tvb_new_subset(tvb, offset - 16,
2339 command_length, /* Physical length */
2340 command_length); /* Length reported by the protocol */
2342 pdu_tvb = tvb_new_subset(tvb, offset - 16,
2343 tvb_length_remaining(tvb, offset - 16),/* Physical length */
2344 command_length); /* Length reported by the protocol */
2350 * If "tree" is NULL, Wireshark is only interested in creation
2351 * of conversations, reassembly and subdissection but not in
2352 * the detailed protocol tree.
2353 * In the interest of speed, skip the generation of protocol tree
2354 * items when "tree" is NULL.
2356 * The only PDU which requires subdissection currently is the
2357 * sm_submit PDU (command ID = 0x00000004).
2359 if (tree || (command_id == 4))
2362 * Create display subtree for the PDU
2365 proto_tree_add_uint(smpp_tree, hf_smpp_command_length,
2366 pdu_tvb, 0, 4, command_length);
2367 proto_tree_add_uint(smpp_tree, hf_smpp_command_id,
2368 pdu_tvb, 4, 4, command_id);
2369 proto_item_append_text(ti, ", Command: %s", command_str);
2372 * Status is only meaningful with responses
2374 if (command_id & 0x80000000) {
2375 proto_tree_add_uint(smpp_tree, hf_smpp_command_status,
2376 pdu_tvb, 8, 4, command_status);
2377 proto_item_append_text (ti, ", Status: \"%s\"",
2378 command_status_str);
2380 proto_tree_add_uint(smpp_tree, hf_smpp_sequence_number,
2381 pdu_tvb, 12, 4, sequence_number);
2382 proto_item_append_text(ti, ", Seq: %u, Len: %u",
2383 sequence_number, command_length);
2387 * End of fixed header.
2388 * Don't dissect variable part if it is shortened.
2390 * FIXME - We then do not report a Short Frame or Malformed Packet
2392 if (command_length <= tvb_reported_length(pdu_tvb))
2394 tvbuff_t *tmp_tvb = tvb_new_subset(pdu_tvb, 16,
2395 -1, command_length - 16);
2396 if (command_id & 0x80000000)
2398 switch (command_id & 0x7FFFFFFF) {
2400 * All of these only have a fixed header
2402 case 0: /* Generic nack */
2403 case 6: /* Unbind resp */
2404 case 7: /* Replace SM resp */
2405 case 8: /* Cancel SM resp */
2406 case 21: /* Enquire link resp */
2407 case 275: /* Cancel Broadcast SM resp */
2409 /* FIXME: The body of the response PDUs are only
2410 * only dissected if the request was successful.
2411 * However, in SMPP 5.0 some responses might
2412 * contain body to provide additional information
2413 * about the error. This needs to be handled.
2416 if (!command_status)
2417 bind_receiver_resp(smpp_tree, tmp_tvb);
2420 if (!command_status)
2421 bind_transmitter_resp(smpp_tree, tmp_tvb);
2424 if (!command_status)
2425 query_sm_resp(smpp_tree, tmp_tvb);
2428 if (!command_status)
2429 submit_sm_resp(smpp_tree, tmp_tvb);
2432 if (!command_status)
2433 deliver_sm_resp(smpp_tree, tmp_tvb);
2436 if (!command_status)
2437 bind_transceiver_resp(smpp_tree, tmp_tvb);
2440 if (!command_status)
2441 submit_multi_resp(smpp_tree, tmp_tvb);
2444 if (!command_status)
2445 data_sm_resp(smpp_tree, tmp_tvb);
2448 if (!command_status)
2449 broadcast_sm_resp(smpp_tree, tmp_tvb);
2452 if (!command_status)
2453 query_broadcast_sm_resp(smpp_tree, tmp_tvb);
2457 } /* switch (command_id & 0x7FFFFFFF) */
2461 switch (command_id) {
2463 bind_receiver(smpp_tree, tmp_tvb);
2466 bind_transmitter(smpp_tree, tmp_tvb);
2469 query_sm(smpp_tree, tmp_tvb);
2472 submit_sm(smpp_tree, tmp_tvb, pinfo, tree);
2475 deliver_sm(smpp_tree, tmp_tvb, pinfo, tree);
2477 case 6: /* Unbind */
2478 case 21: /* Enquire link */
2481 replace_sm(smpp_tree, tmp_tvb);
2484 cancel_sm(smpp_tree, tmp_tvb);
2487 bind_transceiver(smpp_tree, tmp_tvb);
2490 outbind(smpp_tree, tmp_tvb);
2493 submit_multi(smpp_tree, tmp_tvb);
2496 alert_notification(smpp_tree, tmp_tvb);
2499 data_sm(smpp_tree, tmp_tvb);
2502 broadcast_sm(smpp_tree, tmp_tvb);
2505 query_broadcast_sm(smpp_tree, tmp_tvb);
2508 cancel_broadcast_sm(smpp_tree, tmp_tvb);
2512 } /* switch (command_id) */
2513 } /* if (command_id & 0x80000000) */
2515 } /* if (command_length <= tvb_reported_length(pdu_tvb)) */
2516 offset += command_length;
2517 } /* if (tree || (command_id == 4)) */
2519 /* Queue packet for Tap */
2520 tap_rec = ep_alloc0(sizeof(smpp_tap_rec_t));
2521 tap_rec->command_id = command_id;
2522 tap_rec->command_status = command_status;
2523 tap_queue_packet(smpp_tap, pinfo, tap_rec);
2532 /* Register the protocol with Wireshark */
2534 proto_register_smpp(void)
2536 module_t *smpp_module; /* Preferences for SMPP */
2538 /* Setup list of header fields */
2539 static hf_register_info hf[] = {
2540 { &hf_smpp_command_length,
2541 { "Length", "smpp.command_length",
2542 FT_UINT32, BASE_DEC, NULL, 0x00,
2543 "Total length of the SMPP PDU.",
2547 { &hf_smpp_command_id,
2548 { "Operation", "smpp.command_id",
2549 FT_UINT32, BASE_HEX, VALS(vals_command_id), 0x00,
2550 "Defines the SMPP PDU.",
2554 { &hf_smpp_command_status,
2555 { "Result", "smpp.command_status",
2556 FT_UINT32, BASE_HEX, VALS(vals_command_status), 0x00,
2557 "Indicates success or failure of the SMPP request.",
2561 { &hf_smpp_sequence_number,
2562 { "Sequence #", "smpp.sequence_number",
2563 FT_UINT32, BASE_DEC, NULL, 0x00,
2564 "A number to correlate requests with responses.",
2568 { &hf_smpp_system_id,
2569 { "System ID", "smpp.system_id",
2570 FT_STRING, BASE_NONE, NULL, 0x00,
2571 "Identifies a system.",
2575 { &hf_smpp_password,
2576 { "Password", "smpp.password",
2577 FT_STRING, BASE_NONE, NULL, 0x00,
2578 "Password used for authentication.",
2582 { &hf_smpp_system_type,
2583 { "System type", "smpp.system_type",
2584 FT_STRING, BASE_NONE, NULL, 0x00,
2585 "Categorizes the system.",
2589 { &hf_smpp_interface_version,
2590 { "Version (if)", "smpp.interface_version",
2591 FT_STRING, BASE_NONE, NULL, 0x00,
2592 "Version of SMPP interface supported.",
2596 { &hf_smpp_service_type,
2597 { "Service type", "smpp.service_type",
2598 FT_STRING, BASE_NONE, NULL, 0x00,
2599 "SMS application service associated with the message.",
2603 { &hf_smpp_addr_ton,
2604 { "Type of number", "smpp.addr_ton",
2605 FT_UINT8, BASE_HEX, VALS(vals_addr_ton), 0x00,
2606 "Indicates the type of number, given in the address.",
2610 { &hf_smpp_source_addr_ton,
2611 { "Type of number (originator)", "smpp.source_addr_ton",
2612 FT_UINT8, BASE_HEX, VALS(vals_addr_ton), 0x00,
2613 "Indicates originator type of number, given in the address.",
2617 { &hf_smpp_dest_addr_ton,
2618 { "Type of number (recipient)", "smpp.dest_addr_ton",
2619 FT_UINT8, BASE_HEX, VALS(vals_addr_ton), 0x00,
2620 "Indicates recipient type of number, given in the address.",
2624 { &hf_smpp_addr_npi,
2625 { "Numbering plan indicator", "smpp.addr_npi",
2626 FT_UINT8, BASE_HEX, VALS(vals_addr_npi), 0x00,
2627 "Gives the numbering plan this address belongs to.",
2631 { &hf_smpp_source_addr_npi,
2632 { "Numbering plan indicator (originator)", "smpp.source_addr_npi",
2633 FT_UINT8, BASE_HEX, VALS(vals_addr_npi), 0x00,
2634 "Gives originator numbering plan this address belongs to.",
2638 { &hf_smpp_dest_addr_npi,
2639 { "Numbering plan indicator (recipient)", "smpp.dest_addr_npi",
2640 FT_UINT8, BASE_HEX, VALS(vals_addr_npi), 0x00,
2641 "Gives recipient numbering plan this address belongs to.",
2645 { &hf_smpp_address_range,
2646 { "Address", "smpp.address_range",
2647 FT_STRING, BASE_NONE, NULL, 0x00,
2648 "Given address or address range.",
2652 { &hf_smpp_source_addr,
2653 { "Originator address", "smpp.source_addr",
2654 FT_STRING, BASE_NONE, NULL, 0x00,
2655 "Address of SME originating this message.",
2659 { &hf_smpp_destination_addr,
2660 { "Recipient address", "smpp.destination_addr",
2661 FT_STRING, BASE_NONE, NULL, 0x00,
2662 "Address of SME receiving this message.",
2666 { &hf_smpp_esm_submit_msg_mode,
2667 { "Messaging mode", "smpp.esm.submit.msg_mode",
2668 FT_UINT8, BASE_HEX, VALS(vals_esm_submit_msg_mode), 0x03,
2669 "Mode attribute for this message.",
2673 { &hf_smpp_esm_submit_msg_type,
2674 { "Message type", "smpp.esm.submit.msg_type",
2675 FT_UINT8, BASE_HEX, VALS(vals_esm_submit_msg_type), 0x3C,
2676 "Type attribute for this message.",
2680 { &hf_smpp_esm_submit_features,
2681 { "GSM features", "smpp.esm.submit.features",
2682 FT_UINT8, BASE_HEX, VALS(vals_esm_submit_features), 0xC0,
2683 "GSM network specific features.",
2687 /*! \todo Get proper values from GSM-spec. */
2688 { &hf_smpp_protocol_id,
2689 { "Protocol id.", "smpp.protocol_id",
2690 FT_UINT8, BASE_HEX, NULL, 0x00,
2691 "Protocol identifier according GSM 03.40.",
2695 { &hf_smpp_priority_flag,
2696 { "Priority level", "smpp.priority_flag",
2697 FT_UINT8, BASE_HEX, VALS(vals_priority_flag), 0x00,
2698 "The priority level of the short message.",
2702 { &hf_smpp_schedule_delivery_time,
2703 { "Scheduled delivery time", "smpp.schedule_delivery_time",
2704 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2705 "Scheduled time for delivery of short message.",
2709 { &hf_smpp_schedule_delivery_time_r,
2710 { "Scheduled delivery time", "smpp.schedule_delivery_time_r",
2711 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
2712 "Scheduled time for delivery of short message.",
2716 { &hf_smpp_validity_period,
2717 { "Validity period", "smpp.validity_period",
2718 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2719 "Validity period of this message.",
2723 { &hf_smpp_validity_period_r,
2724 { "Validity period", "smpp.validity_period_r",
2725 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
2726 "Validity period of this message.",
2730 { &hf_smpp_regdel_receipt,
2731 { "Delivery receipt", "smpp.regdel.receipt",
2732 FT_UINT8, BASE_HEX, VALS(vals_regdel_receipt), 0x03,
2733 "SMSC delivery receipt request.",
2737 { &hf_smpp_regdel_acks,
2738 { "Message type", "smpp.regdel.acks",
2739 FT_UINT8, BASE_HEX, VALS(vals_regdel_acks), 0x0C,
2740 "SME acknowledgement request.",
2744 { &hf_smpp_regdel_notif,
2745 { "Intermediate notif", "smpp.regdel.notif",
2746 FT_UINT8, BASE_HEX, VALS(vals_regdel_notif), 0x10,
2747 "Intermediate notification request.",
2751 { &hf_smpp_replace_if_present_flag,
2752 { "Replace", "smpp.replace_if_present_flag",
2753 FT_UINT8, BASE_HEX, VALS(vals_replace_if_present_flag), 0x01,
2754 "Replace the short message with this one or not.",
2758 { &hf_smpp_data_coding,
2759 { "Data coding", "smpp.data_coding",
2760 FT_UINT8, BASE_HEX, NULL, 0x00,
2761 "Defines the encoding scheme of the message.",
2765 { &hf_smpp_sm_default_msg_id,
2766 { "Predefined message", "smpp.sm_default_msg_id",
2767 FT_UINT8, BASE_DEC, NULL, 0x00,
2768 "Index of a predefined ('canned') short message.",
2772 { &hf_smpp_sm_length,
2773 { "Message length", "smpp.sm_length",
2774 FT_UINT8, BASE_DEC, NULL, 0x00,
2775 "Length of the message content.",
2779 { &hf_smpp_short_message,
2780 { "Message", "smpp.message",
2781 FT_NONE, BASE_NONE, NULL, 0x00,
2782 "The actual message or data.",
2786 { &hf_smpp_message_id,
2787 { "Message id.", "smpp.message_id",
2788 FT_STRING, BASE_NONE, NULL, 0x00,
2789 "Identifier of the submitted short message.",
2794 { "Destination list", "smpp.dlist",
2795 FT_NONE, BASE_NONE, NULL, 0x00,
2796 "The list of destinations for a short message.",
2800 { &hf_smpp_dlist_resp,
2801 { "Unsuccessful delivery list", "smpp.dlist_resp",
2802 FT_NONE, BASE_NONE, NULL, 0x00,
2803 "The list of unsuccessful deliveries to destinations.",
2808 { "Distr. list name", "smpp.dl_name",
2809 FT_STRING, BASE_NONE, NULL, 0x00,
2810 "The name of the distribution list.",
2814 { &hf_smpp_final_date,
2815 { "Final date", "smpp.final_date",
2816 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2817 "Date-time when the queried message reached a final state.",
2821 { &hf_smpp_final_date_r,
2822 { "Final date", "smpp.final_date_r",
2823 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
2824 "Date-time when the queried message reached a final state.",
2828 { &hf_smpp_message_state,
2829 { "Message state", "smpp.message_state",
2830 FT_UINT8, BASE_DEC, VALS(vals_message_state), 0x00,
2831 "Specifies the status of the queried short message.",
2835 { &hf_smpp_error_code,
2836 { "Error code", "smpp.error_code",
2837 FT_UINT8, BASE_DEC, NULL, 0x00,
2838 "Network specific error code defining reason for failure.",
2842 { &hf_smpp_error_status_code,
2843 { "Status", "smpp.error_status_code",
2844 FT_UINT32, BASE_HEX, VALS(vals_command_status), 0x00,
2845 "Indicates success/failure of request for this address.",
2849 { &hf_smpp_esme_addr_ton,
2850 { "Type of number (ESME)", "smpp.esme_addr_ton",
2851 FT_UINT8, BASE_HEX, VALS(vals_addr_ton), 0x00,
2852 "Indicates recipient type of number, given in the address.",
2856 { &hf_smpp_esme_addr_npi,
2857 { "Numbering plan indicator (ESME)", "smpp.esme_addr_npi",
2858 FT_UINT8, BASE_HEX, VALS(vals_addr_npi), 0x00,
2859 "Gives the numbering plan this address belongs to.",
2863 { &hf_smpp_esme_addr,
2864 { "ESME address", "smpp.esme_addr",
2865 FT_STRING, BASE_NONE, NULL, 0x00,
2866 "Address of ESME originating this message.",
2870 { &hf_smpp_dest_addr_subunit,
2871 { "Subunit destination", "smpp.dest_addr_subunit",
2872 FT_UINT8, BASE_HEX, VALS(vals_addr_subunit), 0x00,
2873 "Subunit address within mobile to route message to.",
2877 { &hf_smpp_source_addr_subunit,
2878 { "Subunit origin", "smpp.source_addr_subunit",
2879 FT_UINT8, BASE_HEX, VALS(vals_addr_subunit), 0x00,
2880 "Subunit address within mobile that generated the message.",
2884 { &hf_smpp_dest_network_type,
2885 { "Destination network", "smpp.dest_network_type",
2886 FT_UINT8, BASE_HEX, VALS(vals_network_type), 0x00,
2887 "Network associated with the destination address.",
2891 { &hf_smpp_source_network_type,
2892 { "Originator network", "smpp.source_network_type",
2893 FT_UINT8, BASE_HEX, VALS(vals_network_type), 0x00,
2894 "Network associated with the originator address.",
2898 { &hf_smpp_dest_bearer_type,
2899 { "Destination bearer", "smpp.dest_bearer_type",
2900 FT_UINT8, BASE_HEX, VALS(vals_bearer_type), 0x00,
2901 "Desired bearer for delivery of message.",
2905 { &hf_smpp_source_bearer_type,
2906 { "Originator bearer", "smpp.source_bearer_type",
2907 FT_UINT8, BASE_HEX, VALS(vals_bearer_type), 0x00,
2908 "Bearer over which the message originated.",
2912 { &hf_smpp_dest_telematics_id,
2913 { "Telematic interworking (dest)", "smpp.dest_telematics_id",
2914 FT_UINT16, BASE_HEX, NULL, 0x00,
2915 "Telematic interworking to be used for message delivery.",
2919 { &hf_smpp_source_telematics_id,
2920 { "Telematic interworking (orig)", "smpp.source_telematics_id",
2921 FT_UINT16, BASE_HEX, NULL, 0x00,
2922 "Telematic interworking used for message submission.",
2926 { &hf_smpp_qos_time_to_live,
2927 { "Validity period", "smpp.qos_time_to_live",
2928 FT_UINT32, BASE_DEC, NULL, 0x00,
2929 "Number of seconds to retain message before expiry.",
2933 { &hf_smpp_payload_type,
2934 { "Payload", "smpp.payload_type",
2935 FT_UINT8, BASE_DEC, VALS(vals_payload_type), 0x00,
2936 "PDU type contained in the message payload.",
2940 { &hf_smpp_additional_status_info_text,
2941 { "Information", "smpp.additional_status_info_text",
2942 FT_STRING, BASE_NONE, NULL, 0x00,
2943 "Description of the meaning of a response PDU.",
2947 { &hf_smpp_receipted_message_id,
2948 { "SMSC identifier", "smpp.receipted_message_id",
2949 FT_STRING, BASE_NONE, NULL, 0x00,
2950 "SMSC handle of the message being received.",
2954 { &hf_smpp_privacy_indicator,
2955 { "Privacy indicator", "smpp.privacy_indicator",
2956 FT_UINT8, BASE_DEC, VALS(vals_privacy_indicator), 0x00,
2957 "Indicates the privacy level of the message.",
2961 { &hf_smpp_source_subaddress,
2962 { "Source Subaddress", "smpp.source_subaddress",
2963 FT_BYTES, BASE_NONE, NULL, 0x00,
2968 { &hf_smpp_dest_subaddress,
2969 { "Destination Subaddress", "smpp.dest_subaddress",
2970 FT_BYTES, BASE_NONE, NULL, 0x00,
2975 { &hf_smpp_user_message_reference,
2976 { "Message reference", "smpp.user_message_reference",
2977 FT_UINT16, BASE_HEX, NULL, 0x00,
2978 "Reference to the message, assigned by the user.",
2982 { &hf_smpp_user_response_code,
2983 { "Application response code", "smpp.user_response_code",
2984 FT_UINT8, BASE_HEX, NULL, 0x00,
2985 "A response code set by the user.",
2989 { &hf_smpp_language_indicator,
2990 { "Language", "smpp.language_indicator",
2991 FT_UINT8, BASE_DEC, VALS(vals_language_indicator), 0x00,
2992 "Indicates the language of the short message.",
2996 { &hf_smpp_source_port,
2997 { "Source port", "smpp.source_port",
2998 FT_UINT16, BASE_HEX, NULL, 0x00,
2999 "Application port associated with the source of the message.",
3003 { &hf_smpp_destination_port,
3004 { "Destination port", "smpp.destination_port",
3005 FT_UINT16, BASE_HEX, NULL, 0x00,
3006 "Application port associated with the destination of the message.",
3010 { &hf_smpp_sar_msg_ref_num,
3011 { "SAR reference number", "smpp.sar_msg_ref_num",
3012 FT_UINT16, BASE_DEC, NULL, 0x00,
3013 "Reference number for a concatenated short message.",
3017 { &hf_smpp_sar_total_segments,
3018 { "SAR size", "smpp.sar_total_segments",
3019 FT_UINT16, BASE_DEC, NULL, 0x00,
3020 "Number of segments of a concatenated short message.",
3024 { &hf_smpp_sar_segment_seqnum,
3025 { "SAR sequence number", "smpp.sar_segment_seqnum",
3026 FT_UINT8, BASE_DEC, NULL, 0x00,
3027 "Segment number within a concatenated short message.",
3031 { &hf_smpp_display_time,
3032 { "Display time", "smpp.display_time",
3033 FT_UINT8, BASE_DEC, VALS(vals_display_time), 0x00,
3034 "Associates a display time with the message on the handset.",
3038 { &hf_smpp_sms_signal,
3039 { "SMS signal", "smpp.sms_signal",
3040 FT_UINT16, BASE_HEX, NULL, 0x00,
3041 "Alert the user according to the information contained within this information element.",
3045 { &hf_smpp_ms_validity,
3046 { "Validity info", "smpp.ms_validity",
3047 FT_UINT8, BASE_DEC, VALS(vals_ms_validity), 0x00,
3048 "Associates validity info with the message on the handset.",
3052 { &hf_smpp_dpf_result,
3053 { "Delivery pending set?", "smpp.dpf_result",
3054 FT_UINT8, BASE_DEC, VALS(vals_dpf_result), 0x00,
3055 "Indicates whether Delivery Pending Flag was set.",
3060 { "Request DPF set", "smpp.set_dpf",
3061 FT_UINT8, BASE_DEC, VALS(vals_set_dpf), 0x00,
3062 "Request to set the DPF for certain failure scenario's.",
3066 { &hf_smpp_ms_availability_status,
3067 { "Availability status", "smpp.ms_availability_status",
3068 FT_UINT8, BASE_DEC, VALS(vals_ms_availability_status), 0x00,
3069 "Indicates the availability state of the handset.",
3073 { &hf_smpp_delivery_failure_reason,
3074 { "Delivery failure reason", "smpp.delivery_failure_reason",
3075 FT_UINT8, BASE_DEC, VALS(vals_delivery_failure_reason), 0x00,
3076 "Indicates the reason for a failed delivery attempt.",
3080 { &hf_smpp_more_messages_to_send,
3081 { "More messages?", "smpp.more_messages_to_send",
3082 FT_UINT8, BASE_DEC, VALS(vals_more_messages_to_send), 0x00,
3083 "Indicates more messages pending for the same destination.",
3087 { &hf_smpp_number_of_messages,
3088 { "Number of messages", "smpp.number_of_messages",
3089 FT_UINT8, BASE_DEC, NULL, 0x00,
3090 "Indicates number of messages stored in a mailbox.",
3094 { &hf_smpp_its_reply_type,
3095 { "Reply method", "smpp.its_reply_type",
3096 FT_UINT8, BASE_DEC, VALS(vals_its_reply_type), 0x00,
3097 "Indicates the handset reply method on message receipt.",
3101 { &hf_smpp_ussd_service_op,
3102 { "USSD service operation", "smpp.ussd_service_op",
3103 FT_UINT8, BASE_DEC, VALS(vals_ussd_service_op), 0x00,
3104 "Indicates the USSD service operation.",
3108 { &hf_smpp_vendor_op,
3109 { "Value", "smpp.vendor_op",
3110 FT_BYTES, BASE_NONE, NULL, 0x00,
3111 "A supplied optional parameter specific to an SMSC-vendor.",
3115 { &hf_smpp_reserved_op,
3116 { "Value", "smpp.reserved_op",
3117 FT_BYTES, BASE_NONE, NULL, 0x00,
3118 "An optional parameter that is reserved in this version.",
3122 { &hf_smpp_msg_wait_ind,
3123 { "Indication", "smpp.msg_wait.ind",
3124 FT_UINT8, BASE_HEX, VALS(vals_msg_wait_ind), 0x80,
3125 "Indicates to the handset that a message is waiting.",
3129 { &hf_smpp_msg_wait_type,
3130 { "Type", "smpp.msg_wait.type",
3131 FT_UINT8, BASE_HEX, VALS(vals_msg_wait_type), 0x03,
3132 "Indicates type of message that is waiting.",
3136 { &hf_smpp_SC_interface_version,
3137 { "SMSC-supported version", "smpp.SC_interface_version",
3138 FT_STRING, BASE_NONE, NULL, 0x00,
3139 "Version of SMPP interface supported by the SMSC.",
3143 { &hf_smpp_callback_num_pres,
3144 { "Presentation", "smpp.callback_num.pres",
3145 FT_UINT8, BASE_HEX, VALS(vals_callback_num_pres), 0x0C,
3146 "Controls the presentation indication.",
3150 { &hf_smpp_callback_num_scrn,
3151 { "Screening", "smpp.callback_num.scrn",
3152 FT_UINT8, BASE_HEX, VALS(vals_callback_num_scrn), 0x03,
3153 "Controls screening of the callback-number.",
3157 { &hf_smpp_callback_num_atag,
3158 { "Callback number - alphanumeric display tag",
3159 "smpp.callback_num_atag",
3160 FT_NONE, BASE_NONE, NULL, 0x00,
3161 "Associates an alphanumeric display with call back number.",
3165 { &hf_smpp_callback_num,
3166 { "Callback number", "smpp.callback_num",
3167 FT_NONE, BASE_NONE, NULL, 0x00,
3168 "Associates a call back number with the message.",
3172 { &hf_smpp_network_error_type,
3173 { "Error type", "smpp.network_error.type",
3174 FT_UINT8, BASE_DEC, VALS(vals_network_error_type), 0x00,
3175 "Indicates the network type.",
3179 { &hf_smpp_network_error_code,
3180 { "Error code", "smpp.network_error.code",
3181 FT_UINT16, BASE_HEX, NULL, 0x00,
3182 "Gives the actual network error code.",
3186 { &hf_smpp_message_payload,
3187 { "Payload", "smpp.message_payload",
3188 FT_NONE, BASE_NONE, NULL, 0x00,
3189 "Short message user data.",
3193 { &hf_smpp_alert_on_message_delivery_null,
3194 { "Alert on delivery", "smpp.alert_on_message_delivery",
3195 FT_NONE, BASE_NONE, NULL, 0x00,
3196 "Instructs the handset to alert user on message delivery.",
3200 { &hf_smpp_alert_on_message_delivery,
3201 { "Alert on delivery", "smpp.alert_on_message_delivery",
3202 FT_UINT8, BASE_DEC, VALS(vals_alert_on_message_delivery), 0x00,
3203 "Instructs the handset to alert user on message delivery.",
3207 { &hf_smpp_its_session_number,
3208 { "Session number", "smpp.its_session.number",
3209 FT_UINT8, BASE_DEC, NULL, 0x00,
3210 "Session number of interactive teleservice.",
3214 { &hf_smpp_its_session_sequence,
3215 { "Sequence number", "smpp.its_session.sequence",
3216 FT_UINT8, BASE_HEX, NULL, 0xFE,
3217 "Sequence number of the dialogue unit.",
3221 { &hf_smpp_its_session_ind,
3222 { "Session indicator", "smpp.its_session.ind",
3223 FT_UINT8, BASE_HEX, VALS(vals_its_session_ind), 0x01,
3224 "Indicates whether this message is end of conversation.",
3228 { &hf_smpp_opt_params,
3229 { "Optional parameters", "smpp.opt_params",
3230 FT_NONE, BASE_NONE, NULL, 0x00,
3231 "The list of optional parameters in this operation.",
3235 { &hf_smpp_opt_param,
3236 { "Optional parameter", "smpp.opt_param",
3237 FT_NONE, BASE_NONE, NULL, 0x00,
3242 { &hf_smpp_opt_param_tag,
3243 { "Tag", "smpp.opt_param_tag",
3244 FT_UINT16, BASE_HEX, NULL, 0x00,
3245 "Optional parameter intentifier tag",
3249 { &hf_smpp_opt_param_len,
3250 { "Length", "smpp.opt_param_len",
3251 FT_UINT16, BASE_DEC, NULL, 0x00,
3252 "Optional parameter length",
3258 * Data Coding Scheme
3261 { "SMPP Data Coding Scheme", "smpp.dcs",
3262 FT_UINT8, BASE_HEX, VALS(vals_data_coding), 0x00,
3263 "Data Coding Scheme according to SMPP.",
3267 { &hf_smpp_dcs_sms_coding_group,
3268 { "DCS Coding Group for SMS", "smpp.dcs.sms_coding_group",
3269 FT_UINT8, BASE_HEX, VALS(vals_dcs_sms_coding_group), 0xF0,
3270 "Data Coding Scheme coding group for GSM Short Message Service.",
3274 { &hf_smpp_dcs_text_compression,
3275 { "DCS Text compression", "smpp.dcs.text_compression",
3276 FT_BOOLEAN, 8, TFS(&tfs_dcs_text_compression), 0x20,
3277 "Indicates if text compression is used.", HFILL
3280 { &hf_smpp_dcs_class_present,
3281 { "DCS Class present", "smpp.dcs.class_present",
3282 FT_BOOLEAN, 8, TFS(&tfs_dcs_class_present), 0x10,
3283 "Indicates if the message class is present (defined).", HFILL
3286 { &hf_smpp_dcs_charset,
3287 { "DCS Character set", "smpp.dcs.charset",
3288 FT_UINT8, BASE_HEX, VALS(vals_dcs_charset), 0x0C,
3289 "Specifies the character set used in the message.", HFILL
3292 { &hf_smpp_dcs_class,
3293 { "DCS Message class", "smpp.dcs.class",
3294 FT_UINT8, BASE_HEX, VALS(vals_dcs_class), 0x03,
3295 "Specifies the message class.", HFILL
3298 { &hf_smpp_dcs_cbs_coding_group,
3299 { "DCS Coding Group for CBS", "smpp.dcs.cbs_coding_group",
3300 FT_UINT8, BASE_HEX, VALS(vals_dcs_cbs_coding_group), 0xF0,
3301 "Data Coding Scheme coding group for GSM Cell Broadcast Service.",
3305 { &hf_smpp_dcs_cbs_language,
3306 { "DCS CBS Message language", "smpp.dcs.cbs_language",
3307 FT_UINT8, BASE_HEX, VALS(vals_dcs_cbs_language), 0x3F,
3308 "Language of the GSM Cell Broadcast Service message.", HFILL
3311 { &hf_smpp_dcs_cbs_class,
3312 { "DCS CBS Message class", "smpp.dcs.cbs_class",
3313 FT_UINT8, BASE_HEX, VALS(vals_dcs_cbs_class), 0x03,
3314 "Specifies the message class for GSM Cell Broadcast Service, for the Data coding / message handling code group.", HFILL
3317 { &hf_smpp_dcs_wap_charset,
3318 { "DCS Message coding", "smpp.dcs.wap_coding",
3319 FT_UINT8, BASE_HEX, VALS(vals_dcs_wap_charset), 0x0C,
3320 "Specifies the used message encoding, as specified by the WAP Forum (WAP over GSM USSD).", HFILL
3323 { &hf_smpp_dcs_wap_class,
3324 { "DCS CBS Message class", "smpp.dcs.wap_class",
3325 FT_UINT8, BASE_HEX, VALS(vals_dcs_wap_class), 0x03,
3326 "Specifies the message class for GSM Cell Broadcast Service, as specified by the WAP Forum (WAP over GSM USSD).", HFILL
3329 /* Changes in SMPP 5.0 */
3330 { &hf_smpp_congestion_state,
3331 { "Congestion State", "smpp.congestion_state",
3332 FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(vals_congestion_state), 0x00,
3333 "Congestion info between ESME and MC for flow control/cong. control", HFILL
3336 { &hf_smpp_billing_identification,
3337 { "Billing Identification", "smpp.billing_id",
3338 FT_BYTES, BASE_NONE, NULL, 0x00,
3339 "Billing identification info", HFILL
3342 { &hf_smpp_dest_addr_np_country,
3343 { "Destination Country Code", "smpp.dest_addr_np_country",
3344 FT_BYTES, BASE_NONE, NULL, 0x00,
3345 "Destination Country Code (E.164 Region Code)", HFILL
3348 { &hf_smpp_dest_addr_np_information,
3349 { "Number Portability information", "smpp.dest_addr_np_info",
3350 FT_BYTES, BASE_NONE, NULL, 0x00,
3354 { &hf_smpp_dest_addr_np_resolution,
3355 { "Number Portability query information", "smpp.dest_addr_np_resolution",
3356 FT_UINT8, BASE_DEC, VALS(vals_dest_addr_np_resolution), 0x00,
3357 "Number Portability query information - method used to resolve number", HFILL
3360 { &hf_smpp_source_network_id,
3361 { "Source Network ID", "smpp.source_network_id",
3362 FT_STRING, BASE_NONE, NULL, 0x00,
3363 "Unique ID for a network or ESME operator", HFILL
3366 { &hf_smpp_source_node_id,
3367 { "Source Node ID", "smpp.source_node_id",
3368 FT_BYTES, BASE_NONE, NULL, 0x00,
3369 "Unique ID for a ESME or MC node", HFILL
3372 { &hf_smpp_dest_network_id,
3373 { "Destination Network ID", "smpp.dest_network_id",
3374 FT_STRING, BASE_NONE, NULL, 0x00,
3375 "Unique ID for a network or ESME operator", HFILL
3378 { &hf_smpp_dest_node_id,
3379 { "Destination Node ID", "smpp.dest_node_id",
3380 FT_BYTES, BASE_NONE, NULL, 0x00,
3381 "Unique ID for a ESME or MC node", HFILL
3384 { &hf_smpp_broadcast_channel_indicator,
3385 { "Cell Broadcast channel", "smpp.broadcast_channel_indicator",
3386 FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(vals_broadcast_channel_indicator), 0x00,
3390 { &hf_smpp_broadcast_content_type_nw,
3391 { "Broadcast Content Type - Network Tag", "smpp.broadcast_content_type.nw",
3392 FT_UINT8, BASE_DEC, VALS(vals_broadcast_content_type_nw), 0x00,
3393 "Cell Broadcast content type", HFILL
3396 { &hf_smpp_broadcast_content_type_type,
3397 { "Broadcast Content Type - Content Type", "smpp.broadcast_content_type.type",
3398 FT_UINT16, BASE_HEX, VALS(vals_broadcast_content_type_type), 0x00,
3399 "Cell Broadcast content type", HFILL
3402 { &hf_smpp_broadcast_content_type_info,
3403 { "Broadcast Content Type Info", "smpp.broadcast_content_type.type",
3404 FT_BYTES, BASE_NONE, NULL, 0x00,
3405 "Cell Broadcast content type Info", HFILL
3408 { &hf_smpp_broadcast_message_class,
3409 { "Broadcast Message Class", "smpp.broadcast_message_class",
3410 FT_UINT8, BASE_HEX, VALS(vals_broadcast_message_class), 0x00,
3411 "Cell Broadcast Message Class", HFILL
3414 { &hf_smpp_broadcast_rep_num,
3415 { "Broadcast Message - Number of repetitions requested", "smpp.broadcast_rep_num",
3416 FT_UINT16, BASE_DEC, NULL, 0x00,
3417 "Cell Broadcast Message - Number of repetitions requested", HFILL
3420 { &hf_smpp_broadcast_frequency_interval_unit,
3421 { "Broadcast Message - frequency interval - Unit", "smpp.broadcast_frequency_interval.unit",
3422 FT_UINT8, BASE_HEX, VALS(vals_broadcast_frequency_interval_unit), 0x00,
3423 "Cell Broadcast Message - frequency interval at which broadcast must be repeated", HFILL
3426 { &hf_smpp_broadcast_frequency_interval_value,
3427 { "Broadcast Message - frequency interval - Unit", "smpp.broadcast_frequency_interval.value",
3428 FT_UINT16, BASE_DEC, NULL, 0x00,
3429 "Cell Broadcast Message - frequency interval at which broadcast must be repeated", HFILL
3432 { &hf_smpp_broadcast_area_identifier,
3433 { "Broadcast Message - Area Identifier", "smpp.broadcast_area_identifier",
3434 FT_BYTES, BASE_NONE, NULL, 0x00,
3435 "Cell Broadcast Message - Area Identifier", HFILL
3438 { &hf_smpp_broadcast_area_identifier_format,
3439 { "Broadcast Message - Area Identifier Format", "smpp.broadcast_area_identifier.format",
3440 FT_UINT8, BASE_HEX | BASE_RANGE_STRING, RVALS(vals_broadcast_area_identifier_format), 0x00,
3441 "Cell Broadcast Message - Area Identifier Format", HFILL
3444 { &hf_smpp_broadcast_error_status,
3445 { "Broadcast Message - Error Status", "smpp.broadcast_error_status",
3446 FT_UINT32, BASE_HEX, VALS(vals_command_status), 0x00,
3447 "Cell Broadcast Message - Error Status", HFILL
3450 { &hf_smpp_broadcast_area_success,
3451 { "Broadcast Message - Area Success", "smpp.broadcast_area_success",
3452 FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(vals_broadcast_area_success), 0x00,
3453 "Cell Broadcast Message - success rate indicator (ratio) - No. of BTS which accepted Message:Total BTS", HFILL
3456 { &hf_smpp_broadcast_end_time,
3457 { "Broadcast Message - End Time", "smpp.broadcast_end_time",
3458 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
3459 "Cell Broadcast Message - Date and time at which MC set the state of the message to terminated", HFILL
3462 { &hf_smpp_broadcast_end_time_r,
3463 { "Broadcast Message - End Time", "smpp.broadcast_end_time_r",
3464 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00,
3465 "Cell Broadcast Message - Date and time at which MC set the state of the message to terminated", HFILL
3468 { &hf_smpp_broadcast_service_group,
3469 { "Broadcast Message - Service Group", "smpp.broadcast_service_group",
3470 FT_BYTES, BASE_NONE, NULL, 0x00,
3471 "Cell Broadcast Message - Service Group", HFILL
3475 /* Setup protocol subtree array */
3476 static gint *ett[] = {
3484 DebugLog(("Registering SMPP dissector\n"));
3485 /* Register the protocol name and description */
3486 proto_smpp = proto_register_protocol("Short Message Peer to Peer",
3489 /* Required function calls to register header fields and subtrees used */
3490 proto_register_field_array(proto_smpp, hf, array_length(hf));
3491 proto_register_subtree_array(ett, array_length(ett));
3493 /* Allow other dissectors to find this one by name. */
3494 register_dissector("smpp", dissect_smpp, proto_smpp);
3496 /* Register for tapping */
3497 smpp_tap = register_tap("smpp");
3500 smpp_module = prefs_register_protocol (proto_smpp, NULL);
3501 prefs_register_bool_preference (smpp_module,
3502 "reassemble_smpp_over_tcp",
3503 "Reassemble SMPP over TCP messages spanning multiple TCP segments",
3504 "Whether the SMPP dissector should reassemble messages spanning multiple TCP segments."
3505 " To use this option, you must also enable "
3506 "\"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
3507 &reassemble_over_tcp);
3511 * If dissector uses sub-dissector registration add a registration routine.
3512 * This format is required because a script is used to find these routines and
3513 * create the code that calls these routines.
3516 proto_reg_handoff_smpp(void)
3518 dissector_handle_t smpp_handle;
3521 * SMPP can be spoken on any port under TCP or X.25
3522 * ...how *do* we do that under X.25?
3524 * We can register the heuristic SMPP dissector with X.25, for one
3525 * thing. We don't currently have any mechanism to allow the user
3526 * to specify that a given X.25 circuit is to be dissected as SMPP,
3529 smpp_handle = find_dissector("smpp");
3530 dissector_add_handle("tcp.port", smpp_handle);
3531 heur_dissector_add("tcp", dissect_smpp_heur, proto_smpp);
3532 heur_dissector_add("x.25", dissect_smpp_heur, proto_smpp);
3534 /* Required for call_dissector() */
3535 DebugLog(("Finding gsm-sms-ud subdissector\n"));
3536 gsm_sms_handle = find_dissector("gsm-sms-ud");
3537 DISSECTOR_ASSERT(gsm_sms_handle);
3540 stats_tree_register_with_group("smpp","smpp_commands", "SM_PP Operations", 0,
3541 smpp_stats_tree_per_packet, smpp_stats_tree_init,
3542 NULL, REGISTER_STAT_GROUP_TELEPHONY);