Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

smpp_pdu.def

Go to the documentation of this file.
00001 /* ==================================================================== 
00002  * The Kannel Software License, Version 1.0 
00003  * 
00004  * Copyright (c) 2001-2008 Kannel Group  
00005  * Copyright (c) 1998-2001 WapIT Ltd.   
00006  * All rights reserved. 
00007  * 
00008  * Redistribution and use in source and binary forms, with or without 
00009  * modification, are permitted provided that the following conditions 
00010  * are met: 
00011  * 
00012  * 1. Redistributions of source code must retain the above copyright 
00013  *    notice, this list of conditions and the following disclaimer. 
00014  * 
00015  * 2. Redistributions in binary form must reproduce the above copyright 
00016  *    notice, this list of conditions and the following disclaimer in 
00017  *    the documentation and/or other materials provided with the 
00018  *    distribution. 
00019  * 
00020  * 3. The end-user documentation included with the redistribution, 
00021  *    if any, must include the following acknowledgment: 
00022  *       "This product includes software developed by the 
00023  *        Kannel Group (http://www.kannel.org/)." 
00024  *    Alternately, this acknowledgment may appear in the software itself, 
00025  *    if and wherever such third-party acknowledgments normally appear. 
00026  * 
00027  * 4. The names "Kannel" and "Kannel Group" must not be used to 
00028  *    endorse or promote products derived from this software without 
00029  *    prior written permission. For written permission, please  
00030  *    contact org@kannel.org. 
00031  * 
00032  * 5. Products derived from this software may not be called "Kannel", 
00033  *    nor may "Kannel" appear in their name, without prior written 
00034  *    permission of the Kannel Group. 
00035  * 
00036  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 
00037  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
00038  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
00039  * DISCLAIMED.  IN NO EVENT SHALL THE KANNEL GROUP OR ITS CONTRIBUTORS 
00040  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,  
00041  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT  
00042  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR  
00043  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,  
00044  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE  
00045  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,  
00046  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
00047  * ==================================================================== 
00048  * 
00049  * This software consists of voluntary contributions made by many 
00050  * individuals on behalf of the Kannel Group.  For more information on  
00051  * the Kannel Group, please see <http://www.kannel.org/>. 
00052  * 
00053  * Portions of this software are based upon software originally written at  
00054  * WapIT Ltd., Helsinki, Finland for the Kannel project.  
00055  */ 
00056 
00057 /*
00058  * smpp_pdu.def - definitions of SMPP PDU structure
00059  *
00060  * Lars Wirzenius
00061  * Daniel Lukic <lukic@vivatech.de>:
00062  *     Initial optional parameters implementation.
00063  * Alexander Malysh <a.malysh@centrium.de>:
00064  *     Extended optional parameters implementation.
00065  */
00066 
00067 
00068 #include "smpp_pdu_opt.def"
00069 
00070 
00071 #ifndef PDU
00072 #error Macro PDU not defined.
00073 #endif
00074 
00075 #ifndef INTEGER
00076 #error Macro INTEGER not defined.
00077 #endif
00078 
00079 #ifndef NULTERMINATED
00080 #error Macro NULTERMINATED not defined.
00081 #endif
00082 
00083 #ifndef OCTETS
00084 #error Macro OCTETS not defined.
00085 #endif
00086 
00087 #ifndef OPTIONAL_BEGIN
00088 #error Macro OPTIONAL_BEGIN not defined.
00089 #endif
00090 
00091 #ifndef TLV_INTEGER
00092 #error Macro TLV_INTEGER not defined.
00093 #endif
00094 
00095 #ifndef TLV_NULTERMINATED
00096 #error Macro TLV_NULTERMINATED not defined.
00097 #endif
00098 
00099 #ifndef TLV_OCTETS
00100 #error Macro TLV_OCTETS not defined.
00101 #endif
00102 
00103 #ifndef OPTIONAL_END
00104 #error Macro OPTIONAL_END not defined.
00105 #endif
00106 
00107 /*
00108  * All SMPP PDUs have a common header consisting of four integers.
00109  * The first integer, command_length, is dealt with implicitly by
00110  * the I/O stuff, so we don't store it in the PDU data structure.
00111  * The other three are defined in the HEADER macro.
00112  */
00113 #ifdef HEADER
00114 #error Macro HEADER was already defined.
00115 #endif
00116 #define HEADER  \
00117     INTEGER(command_id, 4) \
00118     INTEGER(command_status, 4) \
00119     INTEGER(sequence_number, 4)
00120 
00121 PDU(bind_transmitter,
00122     0x00000002,
00123     HEADER
00124     NULTERMINATED(system_id, 16)
00125     NULTERMINATED(password, 9)
00126     NULTERMINATED(system_type, 13)
00127     INTEGER(interface_version, 1)
00128     INTEGER(addr_ton, 1)
00129     INTEGER(addr_npi, 1)
00130     NULTERMINATED(address_range, 41)
00131 )
00132 
00133 PDU(bind_transmitter_resp,
00134     0x80000002,
00135     HEADER
00136     NULTERMINATED(system_id, 16)
00137     OPTIONAL_BEGIN
00138     TLV_INTEGER(sc_interface_version, 1)
00139     OPTIONAL_END
00140 )
00141 
00142 PDU(bind_receiver,
00143     0x00000001,
00144     HEADER
00145     NULTERMINATED(system_id, 16)
00146     NULTERMINATED(password, 9)
00147     NULTERMINATED(system_type, 13)
00148     INTEGER(interface_version, 1)
00149     INTEGER(addr_ton, 1)
00150     INTEGER(addr_npi, 1)
00151     NULTERMINATED(address_range, 41)
00152 )
00153 
00154 PDU(bind_receiver_resp,
00155     0x80000001,
00156     HEADER
00157     NULTERMINATED(system_id, 16)
00158     OPTIONAL_BEGIN
00159     TLV_INTEGER(sc_interface_version, 1)
00160     OPTIONAL_END
00161 )
00162 
00163 PDU(bind_transceiver,
00164     0x00000009,
00165     HEADER
00166     NULTERMINATED(system_id, 16)
00167     NULTERMINATED(password, 9)
00168     NULTERMINATED(system_type, 13)
00169     INTEGER(interface_version, 1)
00170     INTEGER(addr_ton, 1)
00171     INTEGER(addr_npi, 1)
00172     NULTERMINATED(address_range, 41)
00173 )
00174 
00175 PDU(bind_transceiver_resp,
00176     0x80000009,
00177     HEADER
00178     NULTERMINATED(system_id, 16)
00179     OPTIONAL_BEGIN
00180     TLV_INTEGER(sc_interface_version, 1)
00181     OPTIONAL_END
00182 )
00183 
00184 PDU(outbind,
00185     0x0000000B,
00186     HEADER
00187     NULTERMINATED(system_id, 16)
00188     NULTERMINATED(password, 9)
00189 )
00190 
00191 PDU(unbind,
00192     0x00000006,
00193     HEADER
00194 )
00195 
00196 PDU(unbind_resp,
00197     0x80000006,
00198     HEADER
00199 )
00200 
00201 PDU(generic_nack,
00202     0x80000000,
00203     HEADER
00204 )
00205 
00206 PDU(submit_sm,
00207     0x00000004,
00208     HEADER
00209     NULTERMINATED(service_type, 6)
00210     INTEGER(source_addr_ton, 1)
00211     INTEGER(source_addr_npi, 1)
00212     NULTERMINATED(source_addr, 21)
00213     INTEGER(dest_addr_ton, 1)
00214     INTEGER(dest_addr_npi, 1)
00215     NULTERMINATED(destination_addr, 21)
00216     INTEGER(esm_class, 1)
00217     INTEGER(protocol_id, 1)
00218     INTEGER(priority_flag, 1)
00219     NULTERMINATED(schedule_delivery_time, 17)
00220     NULTERMINATED(validity_period, 17)
00221     INTEGER(registered_delivery, 1)
00222     INTEGER(replace_if_present_flag, 1)
00223     INTEGER(data_coding, 1)
00224     INTEGER(sm_default_msg_id, 1)
00225     INTEGER(sm_length, 1)
00226     OCTETS(short_message, sm_length)
00227     OPTIONAL_BEGIN
00228     TLV_INTEGER(user_message_reference, 2)
00229     TLV_INTEGER(source_port, 2)
00230     TLV_INTEGER(source_addr_subunit, 1)
00231     TLV_INTEGER(destination_port, 2)
00232     TLV_INTEGER(dest_addr_subunit, 1)
00233     TLV_INTEGER(sar_msg_ref_num, 2)
00234     TLV_INTEGER(sar_total_segments, 1)
00235     TLV_INTEGER(sar_segment_seqnum, 1)
00236     TLV_INTEGER(more_messages_to_send, 1)
00237     TLV_INTEGER(payload_type, 1)
00238     TLV_OCTETS(message_payload, 0, 65536)
00239     TLV_INTEGER(privacy_indicator, 1)
00240     TLV_OCTETS(callback_num, 4, 19)
00241     TLV_INTEGER(callback_num_pres_ind, 1)
00242     TLV_OCTETS(callback_num_atag, 0, 65)
00243     TLV_OCTETS(source_subaddress, 2, 23)
00244     TLV_OCTETS(dest_subaddress, 2, 23)
00245     TLV_INTEGER(user_response_code, 1)
00246     TLV_INTEGER(display_time, 1)
00247     TLV_INTEGER(sms_signal, 2)
00248     TLV_INTEGER(ms_validity, 1)
00249     TLV_INTEGER(ms_msg_wait_facilities, 1)
00250     TLV_INTEGER(number_of_messages, 1)
00251     TLV_INTEGER(alert_on_message_delivery, 0)
00252     TLV_INTEGER(language_indicator, 1)
00253     TLV_INTEGER(its_reply_type, 1)
00254     TLV_OCTETS(its_session_info, 2, 2)
00255     TLV_OCTETS(ussd_service_op, 1, 1)
00256     OPTIONAL_END
00257 )
00258 
00259 PDU(submit_sm_resp,
00260     0x80000004,
00261     HEADER
00262     NULTERMINATED(message_id, 65)
00263 )
00264 
00265 PDU(submit_multi,
00266     0x00000021,
00267     HEADER
00268     NULTERMINATED(service_type, 6)
00269     INTEGER(source_addr_ton, 1)
00270     INTEGER(source_addr_npi, 1)
00271     NULTERMINATED(source_addr, 21)
00272     INTEGER(number_of_dests, 1)
00273     NULTERMINATED(dest_address_es, 254 * 24)
00274     INTEGER(esm_class, 1)
00275     INTEGER(protocol_id, 1)
00276     INTEGER(priority_flag, 1)
00277     NULTERMINATED(schedule_delivery_time, 17)
00278     NULTERMINATED(validity_period, 17)
00279     INTEGER(registered_delivery, 1)
00280     INTEGER(replace_if_present_flag, 1)
00281     INTEGER(data_coding, 1)
00282     INTEGER(sm_default_msg_id, 1)
00283     INTEGER(sm_length, 1)
00284     OCTETS(short_message, sm_length)
00285     OPTIONAL_BEGIN
00286     TLV_INTEGER(user_message_reference, 2)
00287     TLV_INTEGER(source_port, 2)
00288     TLV_INTEGER(source_addr_subunit, 1)
00289     TLV_INTEGER(destination_port, 2)
00290     TLV_INTEGER(dest_addr_subunit, 1)
00291     TLV_INTEGER(sar_msg_ref_num, 2)
00292     TLV_INTEGER(sar_total_segments, 1)
00293     TLV_INTEGER(sar_segment_seqnum, 1)
00294     TLV_INTEGER(payload_type, 1)
00295     TLV_OCTETS(message_payload, 0, 65536)
00296     TLV_INTEGER(privacy_indicator, 1)
00297     TLV_OCTETS(callback_num, 4, 19)
00298     TLV_INTEGER(callback_num_pres_ind, 1)
00299     TLV_OCTETS(callback_num_atag, 0, 65)
00300     TLV_OCTETS(source_subaddress, 2, 23)
00301     TLV_OCTETS(dest_subaddress, 2, 23)
00302     TLV_INTEGER(display_time, 1)
00303     TLV_INTEGER(sms_signal, 2)
00304     TLV_INTEGER(ms_validity, 1)
00305     TLV_INTEGER(ms_msg_wait_facilities, 1)
00306     TLV_INTEGER(alert_on_message_delivery, 0)
00307     TLV_INTEGER(language_indicator, 1)
00308     OPTIONAL_END
00309 )
00310 
00311 PDU(submit_multi_resp,
00312     0x80000021,
00313     HEADER
00314     NULTERMINATED(message_id, 65)
00315     INTEGER(no_unsuccess, 1)
00316 )
00317 
00318 PDU(deliver_sm,
00319     0x00000005,
00320     HEADER
00321     NULTERMINATED(service_type, 6)
00322     INTEGER(source_addr_ton, 1)
00323     INTEGER(source_addr_npi, 1)
00324     NULTERMINATED(source_addr, 21)
00325     INTEGER(dest_addr_ton, 1)
00326     INTEGER(dest_addr_npi, 1)
00327     NULTERMINATED(destination_addr, 21)
00328     INTEGER(esm_class, 1)
00329     INTEGER(protocol_id, 1)
00330     INTEGER(priority_flag, 1)
00331     NULTERMINATED(schedule_delivery_time, 17)
00332     NULTERMINATED(validity_period, 17)
00333     INTEGER(registered_delivery, 1)
00334     INTEGER(replace_if_present_flag, 1)
00335     INTEGER(data_coding, 1)
00336     INTEGER(sm_default_msg_id, 1)
00337     INTEGER(sm_length, 1)
00338     OCTETS(short_message, sm_length)
00339     OPTIONAL_BEGIN
00340     TLV_INTEGER(user_message_reference, 2)
00341     TLV_INTEGER(source_port, 2)
00342     TLV_INTEGER(destination_port, 2)
00343     TLV_INTEGER(sar_msg_ref_num, 2)
00344     TLV_INTEGER(sar_total_segments, 1)
00345     TLV_INTEGER(sar_segment_seqnum, 1)
00346     TLV_INTEGER(user_response_code, 1)
00347     TLV_INTEGER(privacy_indicator, 1)
00348     TLV_INTEGER(payload_type, 1)
00349     TLV_OCTETS(message_payload, 0, 65536)
00350     TLV_OCTETS(callback_num, 4, 19)
00351     TLV_OCTETS(source_subaddress, 2, 23)
00352     TLV_OCTETS(dest_subaddress, 2, 23)
00353     TLV_INTEGER(language_indicator, 1)
00354     TLV_OCTETS(its_session_info, 2, 2)
00355     TLV_OCTETS(network_error_code, 3, 3)
00356     TLV_INTEGER(message_state, 1)
00357     TLV_NULTERMINATED(receipted_message_id, 65)
00358     OPTIONAL_END
00359 )
00360 
00361 PDU(deliver_sm_resp,
00362     0x80000005,
00363     HEADER
00364     NULTERMINATED(message_id, 1)
00365 )
00366 
00367 PDU(data_sm,
00368     0x00000103,
00369     HEADER
00370     NULTERMINATED(service_type, 6)
00371     INTEGER(source_addr_ton, 1)
00372     INTEGER(source_addr_npi, 1)
00373     NULTERMINATED(source_addr, 65)
00374     INTEGER(dest_addr_ton, 1)
00375     INTEGER(dest_addr_npi, 1)
00376     NULTERMINATED(destination_addr, 65)
00377     INTEGER(esm_class, 1)
00378     INTEGER(registered_delivery, 1)
00379     INTEGER(data_coding, 1)
00380     OPTIONAL_BEGIN
00381     TLV_INTEGER(source_port, 2)
00382     TLV_INTEGER(source_addr_subunit, 1)
00383     TLV_INTEGER(source_network_type, 1)
00384     TLV_INTEGER(source_bearer_type, 1)
00385     TLV_INTEGER(source_telematics_id, 1)
00386     TLV_INTEGER(destination_port, 2)
00387     TLV_INTEGER(dest_addr_subunit, 1)
00388     TLV_INTEGER(dest_network_type, 1)
00389     TLV_INTEGER(dest_bearer_type, 1)
00390     TLV_INTEGER(dest_telematics_id, 2)
00391     TLV_INTEGER(sar_msg_ref_num, 2)
00392     TLV_INTEGER(sar_total_segments, 1)
00393     TLV_INTEGER(sar_segment_seqnum, 1)
00394     TLV_INTEGER(more_messages_to_send, 1)
00395     TLV_INTEGER(qos_time_to_live, 4)
00396     TLV_INTEGER(payload_type, 1)
00397     TLV_OCTETS(message_payload, 0, 65536)
00398     TLV_INTEGER(set_dpf, 1)
00399     TLV_NULTERMINATED(receipted_message_id, 65)
00400     TLV_INTEGER(message_state, 1)
00401     TLV_OCTETS(network_error_code, 3, 3)
00402     TLV_INTEGER(user_message_reference, 2)
00403     TLV_INTEGER(privacy_indicator, 1)
00404     TLV_OCTETS(callback_num, 4, 19)
00405     TLV_INTEGER(callback_num_pres_ind, 1)
00406     TLV_OCTETS(callback_num_atag, 0, 65)
00407     TLV_OCTETS(source_subaddress, 2, 23)
00408     TLV_OCTETS(dest_subaddress, 2, 23)
00409     TLV_INTEGER(user_response_code, 1)
00410     TLV_INTEGER(display_time, 1)
00411     TLV_INTEGER(sms_signal, 2)
00412     TLV_INTEGER(ms_validity, 1)
00413     TLV_INTEGER(ms_msg_wait_facilities, 1)
00414     TLV_INTEGER(number_of_messages, 1)
00415     TLV_INTEGER(alert_on_message_delivery, 0)
00416     TLV_INTEGER(language_indicator, 1)
00417     TLV_INTEGER(its_reply_type, 1)
00418     TLV_OCTETS(its_session_info, 2, 2)
00419     OPTIONAL_END
00420 )
00421 
00422 PDU(data_sm_resp,
00423     0x80000103,
00424     HEADER
00425     NULTERMINATED(message_id, 65)
00426     OPTIONAL_BEGIN
00427     TLV_INTEGER(delivery_failure_reason, 1)
00428     TLV_OCTETS(network_error_code, 3, 3)
00429     TLV_NULTERMINATED(additional_status_info_text, 256)
00430     TLV_INTEGER(dpf_result, 1)
00431     OPTIONAL_END
00432 )
00433 
00434 PDU(query_sm,
00435     0x00000003,
00436     HEADER
00437     NULTERMINATED(message_id, 65)
00438     INTEGER(source_addr_ton, 1)
00439     INTEGER(source_addr_npi, 1)
00440     NULTERMINATED(source_addr, 21)
00441 )
00442 
00443 PDU(query_sm_resp,
00444     0x80000003,
00445     HEADER
00446     NULTERMINATED(message_id, 65)
00447     NULTERMINATED(final_date, 17)
00448     INTEGER(message_state, 1)
00449     INTEGER(error_code, 1)
00450 )
00451 
00452 PDU(cancel_sm,
00453     0x00000008,
00454     HEADER
00455     NULTERMINATED(service_type, 6)
00456     NULTERMINATED(message_id, 65)
00457     INTEGER(source_addr_ton, 1)
00458     INTEGER(source_addr_npi, 1)
00459     NULTERMINATED(source_addr, 21)
00460     INTEGER(dest_addr_ton, 1)
00461     INTEGER(dest_addr_npi, 1)
00462     NULTERMINATED(destination_addr, 65)
00463 )
00464 
00465 PDU(cancel_sm_resp,
00466     0x80000008,
00467     HEADER
00468 )
00469 
00470 PDU(replace_sm,
00471     0x00000007,
00472     HEADER
00473     NULTERMINATED(service_type, 6)
00474     NULTERMINATED(message_id, 65)
00475     INTEGER(source_addr_ton, 1)
00476     INTEGER(source_addr_npi, 1)
00477     NULTERMINATED(source_addr, 21)
00478     NULTERMINATED(schedule_delivery_time, 17)
00479     NULTERMINATED(validity_period, 17)
00480     INTEGER(registered_delivery, 1)
00481     INTEGER(sm_default_msg_id, 1)
00482     INTEGER(sm_length, 1)
00483     OCTETS(short_message, sm_length)
00484 )
00485 
00486 PDU(replace_sm_resp,
00487     0x80000007,
00488     HEADER
00489 )
00490 
00491 PDU(enquire_link,
00492     0x00000015,
00493     HEADER
00494 )
00495 
00496 PDU(enquire_link_resp,
00497     0x80000015,
00498     HEADER
00499 )
00500 
00501 PDU(alert_notification,
00502     0x00000102,
00503     HEADER
00504     INTEGER(source_addr_ton, 1)
00505     INTEGER(source_addr_npi, 1)
00506     NULTERMINATED(source_addr, 21)
00507     INTEGER(esme_addr_ton, 1)
00508     INTEGER(esme_addr_npi, 1)
00509     NULTERMINATED(esme_addr, 65)
00510     OPTIONAL_BEGIN
00511     TLV_INTEGER(ms_availability_status, 1)
00512     OPTIONAL_END
00513 )
00514 
00515 #undef PDU
00516 #undef INTEGER
00517 #undef NULTERMINATED
00518 #undef OCTETS
00519 #undef HEADER
00520 #undef OPTIONAL_BEGIN
00521 #undef TLV_INTEGER
00522 #undef TLV_NULTERMINATED
00523 #undef TLV_OCTETS
00524 #undef OPTIONAL_END
00525 
See file LICENSE for details about the license agreement for using, modifying, copying or deriving work from this software.