Kannel: Open Source WAP and SMS gateway
svn-r5336
|
Go to the source code of this file.
Data Structures | |
struct | SMPP_PDU |
Macros | |
#define | OPTIONAL_BEGIN |
#define | TLV_INTEGER(name, max_len) |
#define | TLV_NULTERMINATED(name, max_len) |
#define | TLV_OCTETS(name, min_len, max_len) |
#define | OPTIONAL_END |
#define | INTEGER(name, octets) |
#define | NULTERMINATED(name, max_octets) |
#define | OCTETS(name, field_giving_octets) |
#define | PDU(name, id, fields) name = id, |
#define | OPTIONAL_BEGIN |
#define | TLV_INTEGER(name, octets) long name; |
#define | TLV_NULTERMINATED(name, max_len) Octstr *name; |
#define | TLV_OCTETS(name, min_len, max_len) Octstr *name; |
#define | OPTIONAL_END Dict *tlv; |
#define | INTEGER(name, octets) unsigned long name; |
#define | NULTERMINATED(name, max_octets) Octstr *name; |
#define | OCTETS(name, field_giving_octets) Octstr *name; |
#define | PDU(name, id, fields) struct name { fields } name; |
#define | GSM_ADDR_TON_UNKNOWN 0x00000000 |
#define | GSM_ADDR_TON_INTERNATIONAL 0x00000001 |
#define | GSM_ADDR_TON_NATIONAL 0x00000002 |
#define | GSM_ADDR_TON_NETWORKSPECIFIC 0x00000003 |
#define | GSM_ADDR_TON_SUBSCRIBER 0x00000004 |
#define | GSM_ADDR_TON_ALPHANUMERIC 0x00000005 /* GSM TS 03.38 */ |
#define | GSM_ADDR_TON_ABBREVIATED 0x00000006 |
#define | GSM_ADDR_TON_EXTENSION 0x00000007 /* Reserved */ |
#define | GSM_ADDR_NPI_UNKNOWN 0x00000000 |
#define | GSM_ADDR_NPI_E164 0x00000001 |
#define | GSM_ADDR_NPI_X121 0x00000003 |
#define | GSM_ADDR_NPI_TELEX 0x00000004 |
#define | GSM_ADDR_NPI_NATIONAL 0x00000008 |
#define | GSM_ADDR_NPI_PRIVATE 0x00000009 |
#define | GSM_ADDR_NPI_ERMES 0x0000000A /* ETSI DE/PS 3 01-3 */ |
#define | GSM_ADDR_NPI_INTERNET 0x0000000E /* SMPP v5.0, sec. 4.7.2, page 113 */ |
#define | GSM_ADDR_NPI_EXTENSION 0x0000000F /* Reserved */ |
#define | GSM_ADDR_NPI_WAP_CLIENT_ID 0x00000012 /* SMPP v5.0, sec. 4.7.2, page 113 */ |
#define | ESM_CLASS_SUBMIT_DEFAULT_SMSC_MODE 0x00000000 |
#define | ESM_CLASS_SUBMIT_DATAGRAM_MODE 0x00000001 |
#define | ESM_CLASS_SUBMIT_FORWARD_MODE 0x00000002 |
#define | ESM_CLASS_SUBMIT_STORE_AND_FORWARD_MODE 0x00000003 |
#define | ESM_CLASS_SUBMIT_DELIVERY_ACK 0x00000008 |
#define | ESM_CLASS_SUBMIT_USER_ACK 0x00000010 |
#define | ESM_CLASS_SUBMIT_UDH_INDICATOR 0x00000040 |
#define | ESM_CLASS_SUBMIT_RPI 0x00000080 |
#define | ESM_CLASS_SUBMIT_UDH_AND_RPI 0x000000C0 |
#define | ESM_CLASS_DELIVER_DEFAULT_TYPE 0x00000000 |
#define | ESM_CLASS_DELIVER_SMSC_DELIVER_ACK 0x00000004 |
#define | ESM_CLASS_DELIVER_SME_DELIVER_ACK 0x00000008 |
#define | ESM_CLASS_DELIVER_SME_MANULAL_ACK 0x00000010 |
#define | ESM_CLASS_DELIVER_INTERM_DEL_NOTIFICATION 0x00000020 |
#define | ESM_CLASS_DELIVER_UDH_INDICATOR 0x00000040 |
#define | ESM_CLASS_DELIVER_RPI 0x00000080 |
#define | ESM_CLASS_DELIVER_UDH_AND_RPI 0x000000C0 |
Typedefs | |
typedef struct SMPP_PDU | SMPP_PDU |
Functions | |
int | smpp_pdu_init (Cfg *cfg) |
int | smpp_pdu_shutdown (void) |
SMPP_PDU * | smpp_pdu_create (unsigned long type, unsigned long seq_no) |
void | smpp_pdu_destroy (SMPP_PDU *pdu) |
int | smpp_pdu_is_valid (SMPP_PDU *pdu) |
Octstr * | smpp_pdu_pack (Octstr *smsc_id, SMPP_PDU *pdu) |
SMPP_PDU * | smpp_pdu_unpack (Octstr *smsc_id, Octstr *data_without_len) |
void | smpp_pdu_dump (Octstr *smsc_id, SMPP_PDU *pdu) |
void | smpp_pdu_dump_line (Octstr *smsc_id, SMPP_PDU *pdu) |
long | smpp_pdu_read_len (Connection *conn) |
Octstr * | smpp_pdu_read_data (Connection *conn, long len) |
const char * | smpp_error_to_string (enum SMPP_ERROR_MESSAGES error) |
void | smpp_tlv_add_constant (Octstr *smsc_id, Dict **tlvs) |
#define ESM_CLASS_DELIVER_DEFAULT_TYPE 0x00000000 |
Definition at line 146 of file smpp_pdu.h.
#define ESM_CLASS_DELIVER_INTERM_DEL_NOTIFICATION 0x00000020 |
Definition at line 150 of file smpp_pdu.h.
#define ESM_CLASS_DELIVER_RPI 0x00000080 |
Definition at line 152 of file smpp_pdu.h.
#define ESM_CLASS_DELIVER_SME_DELIVER_ACK 0x00000008 |
Definition at line 148 of file smpp_pdu.h.
#define ESM_CLASS_DELIVER_SME_MANULAL_ACK 0x00000010 |
Definition at line 149 of file smpp_pdu.h.
#define ESM_CLASS_DELIVER_SMSC_DELIVER_ACK 0x00000004 |
Definition at line 147 of file smpp_pdu.h.
Referenced by msg_to_pdu().
#define ESM_CLASS_DELIVER_UDH_AND_RPI 0x000000C0 |
Definition at line 153 of file smpp_pdu.h.
#define ESM_CLASS_DELIVER_UDH_INDICATOR 0x00000040 |
Definition at line 151 of file smpp_pdu.h.
Referenced by msg_to_pdu().
#define ESM_CLASS_SUBMIT_DATAGRAM_MODE 0x00000001 |
Definition at line 137 of file smpp_pdu.h.
#define ESM_CLASS_SUBMIT_DEFAULT_SMSC_MODE 0x00000000 |
Definition at line 136 of file smpp_pdu.h.
#define ESM_CLASS_SUBMIT_DELIVERY_ACK 0x00000008 |
Definition at line 140 of file smpp_pdu.h.
#define ESM_CLASS_SUBMIT_FORWARD_MODE 0x00000002 |
Definition at line 138 of file smpp_pdu.h.
#define ESM_CLASS_SUBMIT_RPI 0x00000080 |
Definition at line 143 of file smpp_pdu.h.
Referenced by data_sm_to_msg(), msg_to_pdu(), and pdu_to_msg().
#define ESM_CLASS_SUBMIT_STORE_AND_FORWARD_MODE 0x00000003 |
Definition at line 139 of file smpp_pdu.h.
Referenced by smsc_smpp_create().
#define ESM_CLASS_SUBMIT_UDH_AND_RPI 0x000000C0 |
Definition at line 144 of file smpp_pdu.h.
#define ESM_CLASS_SUBMIT_UDH_INDICATOR 0x00000040 |
Definition at line 142 of file smpp_pdu.h.
Referenced by data_sm_to_msg(), handle_mo_dcs(), msg_to_pdu(), and pdu_to_msg().
#define ESM_CLASS_SUBMIT_USER_ACK 0x00000010 |
Definition at line 141 of file smpp_pdu.h.
#define GSM_ADDR_NPI_E164 0x00000001 |
Definition at line 123 of file smpp_pdu.h.
#define GSM_ADDR_NPI_ERMES 0x0000000A /* ETSI DE/PS 3 01-3 */ |
Definition at line 128 of file smpp_pdu.h.
#define GSM_ADDR_NPI_EXTENSION 0x0000000F /* Reserved */ |
Definition at line 130 of file smpp_pdu.h.
#define GSM_ADDR_NPI_INTERNET 0x0000000E /* SMPP v5.0, sec. 4.7.2, page 113 */ |
Definition at line 129 of file smpp_pdu.h.
#define GSM_ADDR_NPI_NATIONAL 0x00000008 |
Definition at line 126 of file smpp_pdu.h.
#define GSM_ADDR_NPI_PRIVATE 0x00000009 |
Definition at line 127 of file smpp_pdu.h.
#define GSM_ADDR_NPI_TELEX 0x00000004 |
Definition at line 125 of file smpp_pdu.h.
#define GSM_ADDR_NPI_UNKNOWN 0x00000000 |
Definition at line 122 of file smpp_pdu.h.
#define GSM_ADDR_NPI_WAP_CLIENT_ID 0x00000012 /* SMPP v5.0, sec. 4.7.2, page 113 */ |
Definition at line 131 of file smpp_pdu.h.
#define GSM_ADDR_NPI_X121 0x00000003 |
Definition at line 124 of file smpp_pdu.h.
#define GSM_ADDR_TON_ABBREVIATED 0x00000006 |
Definition at line 119 of file smpp_pdu.h.
#define GSM_ADDR_TON_ALPHANUMERIC 0x00000005 /* GSM TS 03.38 */ |
Definition at line 118 of file smpp_pdu.h.
#define GSM_ADDR_TON_EXTENSION 0x00000007 /* Reserved */ |
Definition at line 120 of file smpp_pdu.h.
#define GSM_ADDR_TON_INTERNATIONAL 0x00000001 |
Definition at line 114 of file smpp_pdu.h.
#define GSM_ADDR_TON_NATIONAL 0x00000002 |
Definition at line 115 of file smpp_pdu.h.
#define GSM_ADDR_TON_NETWORKSPECIFIC 0x00000003 |
Definition at line 116 of file smpp_pdu.h.
#define GSM_ADDR_TON_SUBSCRIBER 0x00000004 |
Definition at line 117 of file smpp_pdu.h.
#define GSM_ADDR_TON_UNKNOWN 0x00000000 |
Definition at line 113 of file smpp_pdu.h.
#define INTEGER | ( | name, | |
octets | |||
) |
Definition at line 99 of file smpp_pdu.h.
Definition at line 99 of file smpp_pdu.h.
#define NULTERMINATED | ( | name, | |
max_octets | |||
) |
Definition at line 100 of file smpp_pdu.h.
Definition at line 100 of file smpp_pdu.h.
#define OCTETS | ( | name, | |
field_giving_octets | |||
) |
Definition at line 101 of file smpp_pdu.h.
Definition at line 101 of file smpp_pdu.h.
#define OPTIONAL_BEGIN |
Definition at line 94 of file smpp_pdu.h.
#define OPTIONAL_BEGIN |
Definition at line 94 of file smpp_pdu.h.
#define OPTIONAL_END |
Definition at line 98 of file smpp_pdu.h.
#define OPTIONAL_END Dict *tlv; |
Definition at line 98 of file smpp_pdu.h.
Definition at line 102 of file smpp_pdu.h.
Definition at line 102 of file smpp_pdu.h.
#define TLV_INTEGER | ( | name, | |
max_len | |||
) |
Definition at line 95 of file smpp_pdu.h.
Definition at line 95 of file smpp_pdu.h.
#define TLV_NULTERMINATED | ( | name, | |
max_len | |||
) |
Definition at line 96 of file smpp_pdu.h.
Definition at line 96 of file smpp_pdu.h.
#define TLV_OCTETS | ( | name, | |
min_len, | |||
max_len | |||
) |
Definition at line 97 of file smpp_pdu.h.
Definition at line 97 of file smpp_pdu.h.
Definition at line 89 of file smpp_pdu.h.
anonymous enum |
enum SMPP_ERROR_MESSAGES |
Definition at line 159 of file smpp_pdu.h.
const char* smpp_error_to_string | ( | enum SMPP_ERROR_MESSAGES | error | ) |
Definition at line 911 of file smpp_pdu.c.
References error(), SMPP_ESME_RALYBND, SMPP_ESME_RBCASTCANCELFAIL, SMPP_ESME_RBCASTFAIL, SMPP_ESME_RBCASTQUERYFAIL, SMPP_ESME_RBINDFAIL, SMPP_ESME_RCANCELFAIL, SMPP_ESME_RCNTSUBDL, SMPP_ESME_RDELIVERYFAILURE, SMPP_ESME_RINVBCAST_REP, SMPP_ESME_RINVBCASTALIAS_NAME, SMPP_ESME_RINVBCASTAREAFMT, SMPP_ESME_RINVBCASTCHANIND, SMPP_ESME_RINVBCASTCNTTYPE, SMPP_ESME_RINVBCASTFREQINT, SMPP_ESME_RINVBCASTMSGCLASS, SMPP_ESME_RINVBCASTSRVGRP, SMPP_ESME_RINVBNDSTS, SMPP_ESME_RINVCMDID, SMPP_ESME_RINVCMDLEN, SMPP_ESME_RINVDCS, SMPP_ESME_RINVDESTFLAG, SMPP_ESME_RINVDFTMSGID, SMPP_ESME_RINVDLNAME, SMPP_ESME_RINVDSTADDRSUBUNIT, SMPP_ESME_RINVDSTADR, SMPP_ESME_RINVDSTNPI, SMPP_ESME_RINVDSTTON, SMPP_ESME_RINVESMCLASS, SMPP_ESME_RINVEXPIRY, SMPP_ESME_RINVMSGLEN, SMPP_ESME_RINVNUMBCAST_AREAS, SMPP_ESME_RINVNUMDESTS, SMPP_ESME_RINVNUMMSGS, SMPP_ESME_RINVPASWD, SMPP_ESME_RINVPRTFLG, SMPP_ESME_RINVREGDLVFLG, SMPP_ESME_RINVREPFLAG, SMPP_ESME_RINVSCHED, SMPP_ESME_RINVSERTYP, SMPP_ESME_RINVSRCADDRSUBUNIT, SMPP_ESME_RINVSRCADR, SMPP_ESME_RINVSRCNPI, SMPP_ESME_RINVSRCTON, SMPP_ESME_RINVSUBREP, SMPP_ESME_RINVSYSID, SMPP_ESME_RINVSYSTYP, SMPP_ESME_RINVTLVLEN, SMPP_ESME_RINVTLVSTREAM, SMPP_ESME_RINVTLVVAL, SMPP_ESME_RMISSINGTLV, SMPP_ESME_RMSGQFUL, SMPP_ESME_ROK, SMPP_ESME_RPROHIBITED, SMPP_ESME_RQUERYFAIL, SMPP_ESME_RREPLACEFAIL, SMPP_ESME_RSERTYPDENIED, SMPP_ESME_RSERTYPUNAUTH, SMPP_ESME_RSERTYPUNAVAIL, SMPP_ESME_RSUBMITFAIL, SMPP_ESME_RSYSERR, SMPP_ESME_RTHROTTLED, SMPP_ESME_RTLVNOTALLWD, SMPP_ESME_RUNKNOWNERR, SMPP_ESME_RX_P_APPN, SMPP_ESME_RX_R_APPN, and SMPP_ESME_RX_T_APPN.
Referenced by handle_pdu().
SMPP_PDU* smpp_pdu_create | ( | unsigned long | type, |
unsigned long | seq_no | ||
) |
Definition at line 400 of file smpp_pdu.c.
References error(), SMPP_PDU::type, and type.
Referenced by handle_bind_receiver(), handle_bind_transmitter(), handle_enquire_link(), handle_pdu(), handle_submit_sm(), handle_unbind(), msg_to_pdu(), open_receiver(), open_transceiver(), open_transmitter(), send_enquire_link(), send_gnack(), send_smpp_thread(), send_unbind(), smpp_emu_handle_pdu(), smpp_emu_writer(), smpp_pdu_unpack(), and smsc_emu_submit_ack().
void smpp_pdu_destroy | ( | SMPP_PDU * | pdu | ) |
Definition at line 434 of file smpp_pdu.c.
References error(), and SMPP_PDU::type.
Referenced by bearerbox_to_smpp(), handle_pdu(), io_thread(), msg_to_pdu(), open_receiver(), open_transceiver(), open_transmitter(), receive_smpp_thread(), send_enquire_link(), send_gnack(), send_messages(), send_smpp_thread(), send_unbind(), smpp_emu_handle_pdu(), smpp_emu_reader(), smpp_emu_writer(), smpp_pdu_destroy_item(), smpp_pdu_unpack(), and smsc_emu_submit_ack().
Definition at line 766 of file smpp_pdu.c.
References debug(), and error().
Referenced by handle_pdu().
Definition at line 816 of file smpp_pdu.c.
References debug(), error(), octstr_create, octstr_destroy(), octstr_format_append(), octstr_get_cstr, and SMPP_PDU::type_name.
int smpp_pdu_init | ( | Cfg * | cfg | ) |
Definition at line 184 of file smpp_pdu.c.
References cfg, cfg_get, cfg_get_integer(), cfg_get_multi_group(), smpp_tlv::constant, debug(), DEFAULT_SMSC_ID, dict_create(), dict_destroy(), dict_get(), dict_put(), dict_put_once(), error(), gwlist_create, gwlist_destroy(), gwlist_extract_first(), gwlist_produce(), initialized, smpp_tlv::length, smpp_tlv::name, octstr_create, octstr_destroy(), octstr_destroy_item(), octstr_format(), octstr_get_cstr, octstr_imm(), octstr_split(), octstr_str_case_compare(), smpp_tlv_destroy(), smpp_tlv::SMPP_TLV_INTEGER, smpp_tlv::SMPP_TLV_NULTERMINATED, smpp_tlv::SMPP_TLV_OCTETS, smsc_id, smpp_tlv::tag, tlvs, tlvs_by_const, tlvs_by_name, tlvs_by_tag, and smpp_tlv::type.
Referenced by init_smppbox(), main(), and smsc2_start().
int smpp_pdu_is_valid | ( | SMPP_PDU * | pdu | ) |
Definition at line 458 of file smpp_pdu.c.
References append_encoded_integer(), error(), gw_assert(), octstr_create, octstr_destroy(), octstr_insert(), octstr_len(), and SMPP_PDU::type.
Referenced by handle_pdu(), send_enquire_link(), send_gnack(), send_pdu(), send_smpp_thread(), send_unbind(), smpp_emu_handle_pdu(), smpp_emu_writer(), and smsc_emu_submit_ack().
Octstr* smpp_pdu_read_data | ( | Connection * | conn, |
long | len | ||
) |
Definition at line 895 of file smpp_pdu.c.
References conn_read_fixed().
Referenced by read_pdu(), receive_smpp_thread(), and smpp_emu_reader().
long smpp_pdu_read_len | ( | Connection * | conn | ) |
Definition at line 869 of file smpp_pdu.c.
References conn_read_fixed(), decode_network_long(), error(), MAX_SMPP_PDU_LEN, MIN_SMPP_PDU_LEN, octstr_destroy(), and octstr_get_many_chars().
Referenced by read_pdu(), receive_smpp_thread(), and smpp_emu_reader().
int smpp_pdu_shutdown | ( | void | ) |
Definition at line 314 of file smpp_pdu.c.
References dict_destroy(), gwlist_destroy(), initialized, smpp_tlv_destroy(), tlvs, tlvs_by_name, and tlvs_by_tag.
Referenced by smsc2_shutdown().
Definition at line 597 of file smpp_pdu.c.
References decode_integer(), error(), octstr_dump, octstr_len(), smpp_pdu_create(), smpp_pdu_destroy(), and type.
Referenced by read_pdu(), receive_smpp_thread(), and smpp_emu_reader().
Definition at line 102 of file smpp_pdu.c.
References smpp_tlv::constant, dict_create(), dict_get(), dict_keys(), dict_put(), gwlist_destroy(), gwlist_extract_first(), octstr_destroy(), octstr_destroy_item(), octstr_duplicate, smsc_id, tlvs, and tlvs_by_const.
Referenced by msg_to_pdu().