Review at  https://gerrit.osmocom.org/7695

WIP: SMPP codec for TITAN

Change-Id: Ib1952ffa0cbc915ab4c088da03fec2da4258b47c
---
A library/SMPP_Types.ttcn
1 file changed, 520 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/95/7695/1

diff --git a/library/SMPP_Types.ttcn b/library/SMPP_Types.ttcn
new file mode 100644
index 0000000..45bca92
--- /dev/null
+++ b/library/SMPP_Types.ttcn
@@ -0,0 +1,520 @@
+module SMPP_Types {
+
+import from General_Types all;
+import from Osmocom_Types all;
+
+type record SMPP_PDU {
+       /* Header */
+       uint32_t        cmd_len,
+       OCT4            cmd_id,
+       SMPP_CmdStatus  cmd_status,
+       uint32_t        seq_nr,
+       /* Mandatory part (non-TLV) */
+       SMPP_MandPars   mand optional,
+       /* Optional part (TLV) */
+       SMPP_TLVs       opt optional
+} with {
+       variant (cmd_len) "LENGTHTO(cmd_len,cmd_id,cmd_status,seq_nr,mand,opt)"
+       variant (mand) "CROSSTAG(
+                               bind_transmitter, cmd_id = 
SMPP_CMD_BIND_TRANSMITTER;
+                               bind_transmitter_resp, cmd_id = 
SMPP_CMD_BIND_TRANSMITTER_RESP;
+                               bind_receiver, cmd_id = SMPP_CMD_BIND_RECEIVER;
+                               bind_receiver_resp, cmd_id = 
SMPP_CMD_BIND_RECEIVER_RESP;
+                               bind_transceiver, cmd_id = 
SMPP_CMD_BIND_TRANSCEIVER;
+                               bind_transceiver_resp, cmd_id = 
SMPP_CMD_BIND_TRANSCEIVER_RESP;
+                               outbind, cmd_id = SMPP_CMD_OUTBIND;
+                               submit_sm, cmd_id = SMPP_CMD_SUBMIT_SM;
+                               submit_sm_resp, cmd_id = 
SMPP_CMD_SUBMIT_SM_RESP;
+                               deliver_sm, cmd_id = SMPP_CMD_DELIVER_SM;
+                               deliver_sm_resp, cmd_id = 
SMPP_CMD_DELIVER_SM_RESP;
+                               alert_notif, cmd_id = 
SMPP_CMD_ALERT_NOTIFICATION;
+                       )"
+}
+
+
+type union SMPP_MandPars {
+       SMPP_Bind_MandPars                      bind_transmitter,
+       SMPP_BindResp_MandPars                  bind_transmitter_resp,
+       SMPP_Bind_MandPars                      bind_receiver,
+       SMPP_BindResp_MandPars                  bind_receiver_resp,
+       SMPP_Bind_MandPars                      bind_transceiver,
+       SMPP_BindResp_MandPars                  bind_transceiver_resp,
+       SMPP_Outbind_MandPars                   outbind,
+       SMPP_SubmitSM_MandPars                  submit_sm,
+       SMPP_SubmitSMResp_MandPars              submit_sm_resp,
+       /* FIXME */
+       SMPP_DeliverSM_MandPars                 deliver_sm,
+       SMPP_DeliverSMResp_MandPars             deliver_sm_resp,
+       /* FIXME */
+       SMPP_AlertNotif_MandPars                alert_notif
+};
+
+/* 4.1.1, 4.1.3, 4.1.5 */
+type record SMPP_Bind_MandPars {
+       COctetString    system_id,
+       COctetString    password,
+       COctetString    system_type,
+       OCT1            interface_version,
+       SMPP_TON        addr_ton,
+       SMPP_NPI        addr_npi,
+       COctetString    addr_range
+}
+
+/* 4.1.2, 4.1.4, 4.1.6 */
+type record SMPP_BindResp_MandPars {
+       COctetString    system_id
+}
+
+/* 4.1.7 */
+type record SMPP_Outbind_MandPars {
+       COctetString    system_id,
+       COctetString    password
+}
+
+/* 4.4.1 Submit SM */
+type record SMPP_SubmitSM_MandPars {
+       COctetString    service_type,
+       SMPP_TON        source_addr_ton,
+       SMPP_NPI        source_addr_npi,
+       COctetString    source_addr,
+       SMPP_TON        dest_addr_ton,
+       SMPP_NPI        dest_addr_npi,
+       COctetString    dest_addr,
+       OCT1            esm_class,
+       OCT1            protocol_id,
+       OCT1            priority_flag,
+       COctetString    schedule_delivery_time,
+       COctetString    validity_period,
+       OCT1            registered_delivery,
+       SMPP_DCS        data_coding,
+       OCT1            sm_default_msg_id,
+       uint8_t         sm_length,
+       octetstring     short_message
+} with { variant (sm_length) "LENGTHTO(short_message)" };
+
+/* 4.4.2 */
+type record SMPP_SubmitSMResp_MandPars {
+       COctetString    message_id
+}
+
+/* 4.6.1 */
+type record SMPP_DeliverSM_MandPars {
+       COctetString    service_type,
+       SMPP_TON        source_addr_ton,
+       SMPP_NPI        source_addr_npi,
+       COctetString    source_addr,
+       SMPP_TON        dest_addr_ton,
+       SMPP_NPI        dest_addr_npi,
+       COctetString    dest_addr,
+       OCT1            esm_class,
+       OCT1            protocol_id,
+       OCT1            priority_flag,
+       COctetString    schedule_delivery_time,
+       COctetString    validity_period,
+       OCT1            registered_delivery,
+       OCT1            replace_if_present_flag,
+       SMPP_DCS        data_coding,
+       OCT1            sm_default_msg_id,
+       uint8_t         sm_length,
+       octetstring     short_message
+} with { variant (sm_length) "LENGTHTO(short_message)" };
+
+/* 4.6.2 */
+type record SMPP_DeliverSMResp_MandPars {
+       COctetString    message_id
+}
+
+/* 4.12.1 */
+type record SMPP_AlertNotif_MandPars {
+       SMPP_TON        source_addr_ton,
+       SMPP_NPI        source_addr_npi,
+       COctetString    source_addr,
+       SMPP_TON        esme_addr_ton,
+       SMPP_NPI        esme_addr_npi,
+       COctetString    esme_addr
+}
+
+
+/* 5.1.2.1 */
+/*
+type enumerated SMPP_CmdId {
+       SMPP_CMD_GENERIC_NACK           ('00000000'O),
+       SMPP_CMD_BIND_RECEIVER          ('00000001'O),
+       SMPP_CMD_BIND_RECEIVER_RESP     ('80000001'O),
+       SMPP_CMD_BIND_TRANSMITTER       ('00000002'O),
+       SMPP_CMD_BIND_TRANSMITTER_RESP  ('80000002'O),
+       SMPP_CMD_QUERY_SM               ('00000003'O),
+       SMPP_CMD_QUERY_SM_RESP          ('80000003'O),
+       SMPP_CMD_SUBMIT_SM              ('00000004'O),
+       SMPP_CMD_SUBMIT_SM_RESP         ('80000004'O),
+       SMPP_CMD_DELIVER_SM             ('00000005'O),
+       SMPP_CMD_DELIVER_SM_RESP        ('80000005'O),
+       SMPP_CMD_UNBIND                 ('00000006'O),
+       SMPP_CMD_UNBIND_RESP            ('80000006'O),
+       SMPP_CMD_REPLACE_SM             ('00000007'O),
+       SMPP_CMD_REPLACE_SM_RESP        ('80000007'O),
+       SMPP_CMD_CANCEL_SM              ('00000008'O),
+       SMPP_CMD_CANCEL_SM_RESP         ('80000008'O),
+       SMPP_CMD_BIND_TRANSCEIVER       ('00000009'O),
+       SMPP_CMD_BIND_TRANSCEIVER_RESP  ('80000009'O),
+
+       SMPP_CMD_OUTBIND                ('0000000B'O),
+
+       SMPP_CMD_BIND_ENQUIRE_LINK      ('00000015'O),
+       SMPP_CMD_BIND_ENQUIRE_LINK_RESP ('80000015'O),
+
+       SMPP_CMD_SUBMIT_MULTI           ('00000021'O),
+       SMPP_CMD_SUBMIT_MULTI_RESP      ('80000021'O),
+
+       SMPP_CMD_ALERT_NOTIFICATION     ('00000102'O),
+
+       SMPP_CMD_DATA_SM                ('00000103'O),
+       SMPP_CMD_DATA_SM_RESP           ('80000103'O)
+} with { variant "FIELDLENGTH(32)" };
+*/
+const OCT4 SMPP_CMD_GENERIC_NACK               := '80000000'O;
+const OCT4 SMPP_CMD_BIND_RECEIVER              := '00000001'O;
+const OCT4 SMPP_CMD_BIND_RECEIVER_RESP         := '80000001'O;
+const OCT4 SMPP_CMD_BIND_TRANSMITTER           := '00000002'O;
+const OCT4 SMPP_CMD_BIND_TRANSMITTER_RESP      := '80000002'O;
+const OCT4 SMPP_CMD_QUERY_SM                   := '00000003'O;
+const OCT4 SMPP_CMD_QUERY_SM_RESP              := '80000003'O;
+const OCT4 SMPP_CMD_SUBMIT_SM                  := '00000004'O;
+const OCT4 SMPP_CMD_SUBMIT_SM_RESP             := '80000004'O;
+const OCT4 SMPP_CMD_DELIVER_SM                 := '00000005'O;
+const OCT4 SMPP_CMD_DELIVER_SM_RESP            := '80000005'O;
+const OCT4 SMPP_CMD_UNBIND                     := '00000006'O;
+const OCT4 SMPP_CMD_UNBIND_RESP                        := '80000006'O;
+const OCT4 SMPP_CMD_REPLACE_SM                 := '00000007'O;
+const OCT4 SMPP_CMD_REPLACE_SM_RESP            := '80000007'O;
+const OCT4 SMPP_CMD_CANCEL_SM                  := '00000008'O;
+const OCT4 SMPP_CMD_CANCEL_SM_RESP             := '00000008'O;
+const OCT4 SMPP_CMD_BIND_TRANSCEIVER           := '00000009'O;
+const OCT4 SMPP_CMD_BIND_TRANSCEIVER_RESP      := '80000009'O;
+const OCT4 SMPP_CMD_OUTBIND                    := '0000000B'O;
+const OCT4 SMPP_CMD_ENQUIRE_LINK               := '00000015'O;
+const OCT4 SMPP_CMD_ENQUIRE_LINK_RESP          := '80000015'O;
+const OCT4 SMPP_CMD_SUBMIT_MULTI               := '00000021'O;
+const OCT4 SMPP_CMD_SUBMIT_MULTI_RESP          := '80000021'O;
+const OCT4 SMPP_CMD_ALERT_NOTIFICATION         := '00000102'O;
+const OCT4 SMPP_CMD_DATA_SM                    := '00000103'O;
+const OCT4 SMPP_CMD_DATA_SM_RESP               := '80000103'O;
+
+/* 5.1.3 */
+type enumerated SMPP_CmdStatus {
+       ESME_ROK                        ('00000000'O),
+       ESME_RINVMSGLEN                 ('00000001'O),
+       ESME_RINVCMDLEN                 ('00000002'O),
+       ESME_RINVCMDID                  ('00000003'O),
+       ESME_RINVBNDSTS                 ('00000004'O),
+       ESME_RALYBND                    ('00000005'O),
+       ESME_RINVPRTFLG                 ('00000006'O),
+       ESME_RINVREGDLVFLG              ('00000007'O),
+       ESME_RSYSERR                    ('00000008'O),
+       ESME_RINVSRCADR                 ('0000000A'O),
+       ESME_RINVDSTADR                 ('0000000B'O),
+       ESME_RINVMSGID                  ('0000000C'O),
+       ESME_RBINDFAIL                  ('0000000D'O),
+       ESME_RINVPASWD                  ('0000000E'O),
+       ESME_RINVSYSID                  ('0000000F'O),
+       ESME_RCANCELFAIL                ('00000011'O),
+       ESME_RREPLACEFAIL               ('00000013'O),
+       ESME_RMSGQFUL                   ('00000014'O),
+       ESME_RINVSERTYP                 ('00000015'O),
+       ESME_RINVNUMDESTS               ('00000033'O),
+       ESME_RINVDLNAME                 ('00000034'O),
+       ESME_RINVDESTFLAG               ('00000040'O),
+       ESME_RINVSUBREP                 ('00000042'O),
+       ESME_RINVESMCLASS               ('00000043'O),
+       ESME_RCNTSUBDL                  ('00000044'O),
+       ESME_RSUBMITFAIL                ('00000045'O),
+       ESME_RINVSRCTON                 ('00000048'O),
+       ESME_RINVSRCNPI                 ('00000049'O),
+       ESME_RINVDSTTON                 ('00000050'O),
+       ESME_RINVDSTNPI                 ('00000051'O),
+       ESME_RINVSYSTYP                 ('00000053'O),
+       ESME_RINVREPFLAG                ('00000054'O),
+       ESME_RINVNUMMSGS                ('00000055'O),
+       ESME_RTHROTTLED                 ('00000058'O),
+       ESME_RINVSCHED                  ('00000061'O),
+       ESME_RINVEXPIRY                 ('00000062'O),
+       ESME_RINVDFTMSGID               ('00000063'O),
+       ESME_RX_T_APPN                  ('00000064'O),
+       ESME_RX_P_APPN                  ('00000065'O),
+       ESME_RX_R_APPN                  ('00000066'O),
+       ESME_RQUERYFAIL                 ('00000067'O),
+       ESME_RINVOPTPARSTREAM           ('000000C0'O),
+       ESME_ROPTPARNOTALLWD            ('000000C1'O),
+       ESME_RINVPARLEN                 ('000000C2'O),
+       ESME_RMISSINGOPTPARAM           ('000000C3'O),
+       ESME_RINVOPTPARAMVAL            ('000000C4'O),
+       ESME_RDELIVERYFAILURE           ('000000FE'O),
+       ESME_RUNKNOWNERR                ('000000FF'O)
+
+} with { variant "FIELDLENGTH(32)" };
+
+/* 5.2.4 */
+const OCT1 SMPP_VERSION_34 :=  '34'O;
+
+/* 5.2.5 */
+type enumerated SMPP_TON {
+       SMPP_TON_UNKNOWN                ('00000000'B),
+       SMPP_TON_INTERNATIONAL          ('00000001'O),
+       SMPP_TON_NATIONAL               ('00000010'O),
+       SMPP_TON_NETWORK_SPECIFIC       ('00000011'O),
+       SMPP_TON_SUBSCRIBER_NUMBER      ('00000100'O),
+       SMPP_TON_ABBREVIATED            ('00000110'O)
+} with { variant "FIELDLENGTH(8)" };
+
+/* 5.2.6 */
+type enumerated SMPP_NPI {
+       SMPP_NPI_UNKNOWN                ('00000000'O),
+       SMPP_NPI_ISDN_E164              ('00000001'O),
+       SMPP_NPI_DATA_X121              ('00000011'O),
+       SMPP_NPI_TELEX_F69              ('00000100'O),
+       SMPP_NPI_MOBILE_E212            ('00000110'O),
+       SMPP_NPI_NATIONAL               ('00001000'O),
+       SMPP_NPI_PRIVATE                ('00001001'O),
+       SMPP_NPI_ERMES                  ('00001010'O),
+       SMPP_NPI_INTERNET               ('00001110'O),
+       SMPP_NPI_WAP_CLIENT_ID          ('00010010'O)
+} with { variant "FIELDLENGTH(8)" };
+
+/* 5.2.19 */
+type enumerated SMPP_DCS {
+       SMPP_DCS_SMSC_DEFAULT           ('00000000'O),
+       SMPP_DCS_IA5_ASCII              ('00000001'O),
+       SMPP_DCS_OCTET_UNSPEC_2         ('00000010'O),
+       SMPP_DCS_LATIN1_8859_1          ('00000011'O),
+       SMPP_DCS_OCTET_UNSPEC_4         ('00000100'O),
+       SMPP_DCS_JIS_X0208              ('00000101'O),
+       SMPP_DCS_CYRILLIC_8859_5        ('00000110'O),
+       SMPP_DCS_HEBREW_8859_8          ('00000111'O),
+       SMPP_DCS_UCS2_IEC10646          ('00001000'O),
+       SMPP_DCS_PICTOGRAM              ('00001001'O),
+       SMPP_DCS_ISO_2022_JP            ('00001010'O),
+       SMPP_DCS_EXT_KANJI_JIS_X0212    ('00001101'O),
+       SMPP_DCS_KS_C_5601              ('00001110'O)
+       /* FIXME: GSM MWI / message class */
+} with { variant "FIELDLENGTH(8)" };
+
+
+/* 5.2.28 */
+type enumerated SMPP_MessageState {
+       SMPP_MSTATE_ENROUTE             (1),
+       SMPP_MSTATE_DELIVERED           (2),
+       SMPP_MSTATE_EXPIRED             (3),
+       SMPP_MSTATE_DELETED             (4),
+       SMPP_MSTATE_UNDELIVERABLE       (5),
+       SMPP_MSTATE_ACCEPTED            (6),
+       SMPP_MSTATE_UNKNOWN             (7),
+       SMPP_MSTATE_REJECTED            (8)
+} with { variant "FIELDLENGTH(8)" };
+
+/* 5.3.2 */
+type enumerated SMPP_IEI {
+       SMPP_IEI_dest_addr_subunit              ('0005'O),
+       SMPP_IEI_dest_network_type              ('0006'O),
+       SMPP_IEI_dest_bearer_type               ('0007'O),
+       SMPP_IEI_dest_telematics_id             ('0008'O),
+       SMPP_IEI_source_addr_subunit            ('000D'O),
+       SMPP_IEI_source_network_type            ('000E'O),
+       SMPP_IEI_source_bearer_type             ('000F'O),
+       SMPP_IEI_source_telematics_id           ('0010'O),
+       SMPP_IEI_qos_time_to_live               ('0017'O),
+       SMPP_IEI_payload_type                   ('0019'O),
+       SMPP_IEI_additional_status_info_text    ('001D'O),
+       SMPP_IEI_receipted_message_id           ('001E'O),
+       SMPP_IEI_ms_msg_wait_facilities         ('0030'O),
+       SMPP_IEI_privacy_indicator              ('0201'O),
+       SMPP_IEI_source_subaddress              ('0202'O),
+       SMPP_IEI_dest_subaddress                ('0203'O),
+       SMPP_IEI_user_message_reference         ('0204'O),
+       SMPP_IEI_user_response_code             ('0205'O),
+       SMPP_IEI_source_port                    ('020A'O),
+       SMPP_IEI_destination_port               ('020B'O),
+       SMPP_IEI_sar_msg_ref_num                ('020C'O),
+       SMPP_IEI_language_indicator             ('020D'O),
+       SMPP_IEI_sar_total_segments             ('020E'O),
+       SMPP_IEI_sar_segment_seqnum             ('020F'O),
+       SMPP_IEI_SC_interface_version           ('0210'O),
+       SMPP_IEI_callback_num_pres_ind          ('0302'O),
+       SMPP_IEI_callback_num_atag              ('0303'O),
+       SMPP_IEI_number_of_messages             ('0304'O),
+       SMPP_IEI_callback_num                   ('0381'O),
+       SMPP_IEI_dpf_result                     ('0420'O),
+       SMPP_IEI_set_dpf                        ('0421'O),
+       SMPP_IEI_ms_availability_status         ('0422'O),
+       SMPP_IEI_network_error_code             ('0423'O),
+       SMPP_IEI_message_payload                ('0424'O),
+       SMPP_IEI_delivery_failure_reason        ('0425'O),
+       SMPP_IEI_more_messages_to_send          ('0426'O),
+       SMPP_IEI_message_state                  ('0427'O),
+       SMPP_IEI_ussd_service_op                ('0501'O),
+       SMPP_IEI_display_time                   ('1201'O),
+       SMPP_IEI_sms_signal                     ('1203'O),
+       SMPP_IEI_ms_validity                    ('1204'O),
+       SMPP_IEI_alert_on_message_delivery      ('130C'O),
+       SMPP_IEI_its_reply_type                 ('1380'O),
+       SMPP_IEI_its_session_info               ('1383'O)
+} with { variant "FIELDLENGTH(16)" };
+
+type record of SMPP_TLV SMPP_TLVs;
+
+type record SMPP_TLV {
+       SMPP_IEI        tag,
+       uint16_t        len,
+       SMPP_IE_Body    val
+} with {
+       variant (len) "LENGTHTO(val)"
+       variant (val) "CROSSTAG(
+                       dest_addr_subunit,              tag = 
SMPP_IEI_dest_addr_subunit;
+                       source_addr_subunit,            tag = 
SMPP_IEI_source_addr_subunit;
+                       dest_network_type,              tag = 
SMPP_IEI_dest_network_type;
+                       source_network_type,            tag = 
SMPP_IEI_source_network_type;
+                       dest_bearer_type,               tag = 
SMPP_IEI_dest_bearer_type;
+                       source_bearer_type,             tag = 
SMPP_IEI_source_bearer_type;
+                       dest_telematics_id,             tag = 
SMPP_IEI_dest_telematics_id;
+                       source_telematics_id,           tag = 
SMPP_IEI_source_telematics_id;
+                       qos_time_to_live,               tag = 
SMPP_IEI_qos_time_to_live;
+                       payload_type,                   tag = 
SMPP_IEI_payload_type;
+                       additional_status_info_text,    tag = 
SMPP_IEI_additional_status_info_text;
+                       receipted_message_id,           tag = 
SMPP_IEI_receipted_message_id;
+                       ms_msg_wait_facilities,         tag = 
SMPP_IEI_ms_msg_wait_facilities;
+                       privacy_indicator,              tag = 
SMPP_IEI_privacy_indicator;
+                       source_subaddress,              tag = 
SMPP_IEI_source_subaddress;
+                       dest_subaddress,                tag = 
SMPP_IEI_dest_subaddress;
+                       user_message_reference,         tag = 
SMPP_IEI_user_message_reference;
+                       user_response_code,             tag = 
SMPP_IEI_user_response_code;
+                       language_indicator,             tag = 
SMPP_IEI_language_indicator;
+                       source_port,                    tag = 
SMPP_IEI_source_port;
+                       destination_port,               tag = 
SMPP_IEI_destination_port;
+                       sar_msg_ref_num,                tag = 
SMPP_IEI_sar_msg_ref_num;
+                       sar_total_segments,             tag = 
SMPP_IEI_sar_total_segments;
+                       sc_interface_version,           tag = 
SMPP_IEI_SC_interface_version;
+                       display_time,                   tag = 
SMPP_IEI_display_time;
+                       ms_validity,                    tag = 
SMPP_IEI_ms_validity;
+                       dpf_result,                     tag = 
SMPP_IEI_dpf_result;
+                       set_dpf,                        tag = SMPP_IEI_set_dpf;
+                       ms_availability_status,         tag = 
SMPP_IEI_ms_availability_status;
+                       message_payload,                tag = 
SMPP_IEI_message_payload;
+                       delivery_failure_reason ,       tag = 
SMPP_IEI_delivery_failure_reason;
+                       more_messages_to_send,          tag = 
SMPP_IEI_more_messages_to_send;
+                       message_state,                  tag = 
SMPP_IEI_message_state;
+                       callback_num,                   tag = 
SMPP_IEI_callback_num;
+                       callback_num_pres_ind,          tag = 
SMPP_IEI_callback_num_pres_ind;
+                       callback_num_atag,              tag = 
SMPP_IEI_callback_num_atag;
+                       number_of_messages,             tag = 
SMPP_IEI_number_of_messages;
+                       sms_signal,                     tag = 
SMPP_IEI_sms_signal;
+                       its_reply_type,                 tag = 
SMPP_IEI_its_reply_type;
+                       its_session_info,               tag = 
SMPP_IEI_its_session_info;
+                       ussd_service_op,                tag = 
SMPP_IEI_ussd_service_op;
+                       other,                          OTHERWISE;
+               )"
+};
+
+type union SMPP_IE_Body {
+       SMPP_Subunit            dest_addr_subunit,
+       SMPP_Subunit            source_addr_subunit,
+       SMPP_NetworkType        dest_network_type,
+       SMPP_NetworkType        source_network_type,
+       SMPP_BearerType         dest_bearer_type,
+       SMPP_BearerType         source_bearer_type,
+       uint16_t                dest_telematics_id,
+       uint16_t                source_telematics_id,
+       uint32_t                qos_time_to_live,
+       uint8_t                 payload_type,
+       COctetString            additional_status_info_text,
+       COctetString            receipted_message_id,
+       BIT8                    ms_msg_wait_facilities,
+       uint8_t                 privacy_indicator,
+       octetstring             source_subaddress,
+       octetstring             dest_subaddress,
+       uint16_t                user_message_reference,
+       uint8_t                 user_response_code,
+       uint8_t                 language_indicator,
+       uint16_t                source_port,
+       uint16_t                destination_port,
+       uint16_t                sar_msg_ref_num,
+       uint8_t                 sar_total_segments,
+       OCT1                    sc_interface_version,
+       uint8_t                 display_time,
+       uint8_t                 ms_validity,
+       uint8_t                 dpf_result,
+       uint8_t                 set_dpf,
+       SMPP_MsAvailStatus      ms_availability_status,
+       octetstring             message_payload,
+       uint8_t                 delivery_failure_reason,
+       uint8_t                 more_messages_to_send,
+       SMPP_MessageState       message_state,
+       octetstring             callback_num,
+       BIT8                    callback_num_pres_ind,
+       octetstring             callback_num_atag,
+       uint8_t                 number_of_messages,
+       uint16_t                sms_signal,
+       uint8_t                 its_reply_type,
+       OCT2                    its_session_info,
+       OCT1                    ussd_service_op,
+       octetstring             other
+}
+
+/* 5.3.2.1 */
+type enumerated SMPP_Subunit {
+       SMPP_SUBUNIT_UNKNOWN            ('00'O),
+       SMPP_SUBUNIT_MS_DISPLAY         ('01'O),
+       SMPP_SUBUNIT_MOBILE_EQUIPMENT   ('02'O),
+       SMPP_SUBUNIT_SMART_CARD_1       ('03'O),
+       SMPP_SUBINIT_EXTERNAL_1         ('04'O)
+} with { variant "FIELDLENGTH(8)" };
+
+/*5.3.2.3 */
+type enumerated SMPP_NetworkType {
+       SMPP_NETT_UNKNOWN               ('00'O),
+       SMPP_NETT_GSM                   ('01'O),
+       SMPP_NETT_ANSI136_TDMA          ('02'O),
+       SMPP_NETT_IS95_CDMA             ('03'O),
+       SMPP_NETT_PDC                   ('04'O),
+       SMPP_NETT_PHS                   ('05'O),
+       SMPP_NETT_IDEN                  ('06'O),
+       SMPP_NETT_AMPS                  ('07'O),
+       SMPP_NETT_PAGING                ('08'O)
+} with { variant "FIELDLENGTH(8)" };
+
+/* 6.3.2.5 */
+type enumerated SMPP_BearerType {
+       SMPP_BEART_UNKNOWN              ('00'O),
+       SMPP_BEART_SMS                  ('01'O),
+       SMPP_BEART_CSD                  ('02'O),
+       SMPP_BEART_PACKET_DATA          ('03'O),
+       SMPP_BEART_USSD                 ('04'O),
+       SMPP_BEART_CDPD                 ('05'O),
+       SMPP_BEART_DATATAC              ('06'O),
+       SMPP_BEART_FLEX                 ('07'O),
+       SMPP_BEART_CELL_BROADCAST       ('08'O)
+} with { variant "FIELDLENGTH(8)" };
+
+
+/* 5.3.2.30 */
+type enumerated SMPP_MsAvailStatus {
+       SMPP_MS_AVAIL_AVAILABLE         ('00'O),
+       SMPP_MS_AVAIL_DENIED            ('01'O),
+       SMPP_MS_AVAIL_UNAVAILABLE       ('02'O)
+} with { variant "FIELDLENGTH(8)" };
+
+/* 5.3.2.31 */
+type record SMPP_NetErrCode {
+       SMPP_NetErrCodeType     net_type,
+       uint16_t                err_code
+} with { variant "" };
+type enumerated SMPP_NetErrCodeType {
+       SMPP_ERR_NETT_ANSI136           ('01'O),
+       SMPP_ERR_NETT_IS95              ('02'O),
+       SMPP_ERR_NETT_GSM               ('03'O),
+       SMPP_ERR_NETT_RESERVED          ('04'O)
+} with { variant "FIELDLENGTH(8)" };
+
+
+type octetstring COctetString; /* FIXME: How to express this in "RAW" syntax? 
*/
+
+
+} with { encode "RAW" };

-- 
To view, visit https://gerrit.osmocom.org/7695
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib1952ffa0cbc915ab4c088da03fec2da4258b47c
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>

Reply via email to