Kannel: Open Source WAP and SMS gateway
svn-r5336
|
Go to the source code of this file.
Data Structures | |
struct | smpp_tlv |
Macros | |
#define | MIN_SMPP_PDU_LEN (4*4) |
#define | MAX_SMPP_PDU_LEN (7424) |
#define | DEFAULT_SMSC_ID "def;ault" |
#define | OPTIONAL_BEGIN |
#define | TLV_INTEGER(name, octets) OCTETS(name, octets) |
#define | TLV_NULTERMINATED(name, max_len) OCTETS(name, max_len) |
#define | TLV_OCTETS(name, min_len, max_len) OCTETS(name, min_len) |
#define | OPTIONAL_END |
#define | INTEGER(name, octets) OCTETS(name, octets) |
#define | NULTERMINATED(name, max_octets) OCTETS(name, max_octets) |
#define | OCTETS(name, field_giving_octetst) |
#define | PDU(name, id, fields) |
#define | OPTIONAL_BEGIN |
#define | TLV_INTEGER(name, octets) p->name = -1; |
#define | TLV_NULTERMINATED(name, max_len) p->name = NULL; |
#define | TLV_OCTETS(name, min_len, max_len) p->name = NULL; |
#define | OPTIONAL_END p->tlv = dict_create(1024, octstr_destroy_item); |
#define | INTEGER(name, octets) p->name = 0; |
#define | NULTERMINATED(name, max_octets) p->name = NULL; |
#define | OCTETS(name, field_giving_octetst) p->name = NULL; |
#define | PDU(name, id, fields) |
#define | OPTIONAL_BEGIN |
#define | TLV_INTEGER(name, octets) p->name = -1; |
#define | TLV_NULTERMINATED(name, max_octets) octstr_destroy(p->name); |
#define | TLV_OCTETS(name, min_len, max_len) octstr_destroy(p->name); |
#define | OPTIONAL_END dict_destroy(p->tlv); |
#define | INTEGER(name, octets) p->name = 0; /* Make sure "p" is used */ |
#define | NULTERMINATED(name, max_octets) octstr_destroy(p->name); |
#define | OCTETS(name, field_giving_octets) octstr_destroy(p->name); |
#define | PDU(name, id, fields) case id: { struct name *p = &pdu->u.name; fields } break; |
#define | OPTIONAL_BEGIN |
#define | TLV_INTEGER(name, octets) |
#define | TLV_NULTERMINATED(name, max_len) |
#define | TLV_OCTETS(name, min_len, max_len) |
#define | OPTIONAL_END |
#define | INTEGER(name, octets) p = *(&p); |
#define | NULTERMINATED(name, max_octets) p = *(&p); |
#define | OCTETS(name, field_giving_octets) p->field_giving_octets = octstr_len(p->name); |
#define | PDU(name, id, fields) case id: { struct name *p = &pdu->u.name; fields } break; |
#define | TL(name, octets) |
#define | OPTIONAL_BEGIN |
#define | TLV_INTEGER(name, octets) |
#define | TLV_NULTERMINATED(name, max_len) |
#define | TLV_OCTETS(name, min_len, max_len) |
#define | OPTIONAL_END |
#define | INTEGER(name, octets) append_encoded_integer(os, p->name, octets); |
#define | NULTERMINATED(name, max_octets) |
#define | OCTETS(name, field_giving_octets) if (p->name) octstr_append(os, p->name); |
#define | PDU(name, id, fields) case id: { struct name *p = &pdu->u.name; fields } break; |
#define | OPTIONAL_BEGIN |
#define | TLV_INTEGER(mname, octets) |
#define | TLV_NULTERMINATED(mname, max_len) |
#define | TLV_OCTETS(mname, 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) case id: { struct name *p = &pdu->u.name; fields } break; |
#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) debug("sms.smpp", 0, " %s: %lu = 0x%08lx", #name, p->name, p->name); |
#define | NULTERMINATED(name, max_octets) octstr_dump_short(p->name, 2, #name); |
#define | OCTETS(name, field_giving_octets) octstr_dump_short(p->name, 2, #name); |
#define | PDU(name, id, fields) case id: { struct name *p = &pdu->u.name; fields } break; |
#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) octstr_format_append(str, " [%s:0:0x%08lx]", #name, p->name); |
#define | NULTERMINATED(name, max_octets) octstr_format_append(str, " [%s:%d:%E]", #name, octstr_len(p->name), (p->name != NULL ? p->name : octstr_imm("NULL"))); |
#define | OCTETS(name, field_giving_octets) octstr_format_append(str, " [%s:%d:%E]", #name, octstr_len(p->name), (p->name != NULL ? p->name : octstr_imm("NULL"))); |
#define | PDU(name, id, fields) case id: { struct name *p = &pdu->u.name; fields } break; |
Variables | |
static Dict * | tlvs_by_tag |
static Dict * | tlvs_by_name |
static Dict * | tlvs_by_const |
static List * | tlvs |
static int | initialized |
#define DEFAULT_SMSC_ID "def;ault" |
Definition at line 73 of file smpp_pdu.c.
Referenced by smpp_pdu_init(), smpp_tlv_get_by_name(), and smpp_tlv_get_by_tag().
#define INTEGER | ( | name, | |
octets | |||
) | p = *(&p); |
#define INTEGER | ( | name, | |
octets | |||
) | append_encoded_integer(os, p->name, octets); |
#define INTEGER | ( | name, | |
octets | |||
) |
#define INTEGER | ( | name, | |
octets | |||
) | debug("sms.smpp", 0, " %s: %lu = 0x%08lx", #name, p->name, p->name); |
#define INTEGER | ( | name, | |
octets | |||
) | octstr_format_append(str, " [%s:0:0x%08lx]", #name, p->name); |
#define MAX_SMPP_PDU_LEN (7424) |
Definition at line 71 of file smpp_pdu.c.
Referenced by smpp_pdu_read_len().
#define MIN_SMPP_PDU_LEN (4*4) |
Definition at line 69 of file smpp_pdu.c.
Referenced by smpp_pdu_read_len().
#define NULTERMINATED | ( | name, | |
max_octets | |||
) | octstr_destroy(p->name); |
#define NULTERMINATED | ( | name, | |
max_octets | |||
) | p = *(&p); |
#define NULTERMINATED | ( | name, | |
max_octets | |||
) |
#define NULTERMINATED | ( | name, | |
max_octets | |||
) |
#define NULTERMINATED | ( | name, | |
max_octets | |||
) | octstr_dump_short(p->name, 2, #name); |
#define NULTERMINATED | ( | name, | |
max_octets | |||
) | octstr_format_append(str, " [%s:%d:%E]", #name, octstr_len(p->name), (p->name != NULL ? p->name : octstr_imm("NULL"))); |
#define OCTETS | ( | name, | |
field_giving_octetst | |||
) |
#define OCTETS | ( | name, | |
field_giving_octets | |||
) | octstr_destroy(p->name); |
#define OCTETS | ( | name, | |
field_giving_octets | |||
) | p->field_giving_octets = octstr_len(p->name); |
#define OCTETS | ( | name, | |
field_giving_octets | |||
) | if (p->name) octstr_append(os, p->name); |
#define OCTETS | ( | name, | |
field_giving_octets | |||
) |
#define OCTETS | ( | name, | |
field_giving_octets | |||
) | octstr_dump_short(p->name, 2, #name); |
#define OCTETS | ( | name, | |
field_giving_octets | |||
) | octstr_format_append(str, " [%s:%d:%E]", #name, octstr_len(p->name), (p->name != NULL ? p->name : octstr_imm("NULL"))); |
#define OPTIONAL_BEGIN |
#define OPTIONAL_BEGIN |
#define OPTIONAL_BEGIN |
#define OPTIONAL_BEGIN |
#define OPTIONAL_BEGIN |
#define OPTIONAL_BEGIN |
#define OPTIONAL_BEGIN |
#define OPTIONAL_BEGIN |
#define OPTIONAL_END |
#define OPTIONAL_END p->tlv = dict_create(1024, octstr_destroy_item); |
#define OPTIONAL_END dict_destroy(p->tlv); |
#define OPTIONAL_END |
#define OPTIONAL_END |
#define OPTIONAL_END |
#define OPTIONAL_END |
#define OPTIONAL_END |
#define PDU | ( | name, | |
id, | |||
fields | |||
) |
#define PDU | ( | name, | |
id, | |||
fields | |||
) |
#define TL | ( | name, | |
octets | |||
) |
#define TLV_INTEGER | ( | name, | |
octets | |||
) |
#define TLV_INTEGER | ( | name, | |
octets | |||
) |
#define TLV_INTEGER | ( | mname, | |
octets | |||
) |
#define TLV_INTEGER | ( | name, | |
max_len | |||
) |
#define TLV_INTEGER | ( | name, | |
max_len | |||
) |
#define TLV_NULTERMINATED | ( | name, | |
max_octets | |||
) | octstr_destroy(p->name); |
#define TLV_NULTERMINATED | ( | name, | |
max_len | |||
) |
#define TLV_NULTERMINATED | ( | name, | |
max_len | |||
) |
#define TLV_NULTERMINATED | ( | mname, | |
max_len | |||
) |
#define TLV_NULTERMINATED | ( | name, | |
max_len | |||
) |
#define TLV_NULTERMINATED | ( | name, | |
max_len | |||
) |
#define TLV_OCTETS | ( | name, | |
min_len, | |||
max_len | |||
) | octstr_destroy(p->name); |
#define TLV_OCTETS | ( | name, | |
min_len, | |||
max_len | |||
) |
#define TLV_OCTETS | ( | name, | |
min_len, | |||
max_len | |||
) |
#define TLV_OCTETS | ( | mname, | |
min_len, | |||
max_len | |||
) |
#define TLV_OCTETS | ( | name, | |
min_len, | |||
max_len | |||
) |
#define TLV_OCTETS | ( | name, | |
min_len, | |||
max_len | |||
) |
|
static |
Definition at line 346 of file smpp_pdu.c.
References octstr_append_char().
Referenced by smpp_pdu_pack().
|
static |
Definition at line 355 of file smpp_pdu.c.
References error(), octstr_copy, octstr_search_char(), and warning().
|
static |
Definition at line 330 of file smpp_pdu.c.
References octstr_get_char(), and octstr_len().
Referenced by smpp_pdu_unpack().
|
static |
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().
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().
|
static |
Definition at line 92 of file smpp_pdu.c.
References smpp_tlv::constant, smpp_tlv::name, and octstr_destroy().
Referenced by smpp_pdu_init(), and smpp_pdu_shutdown().
Definition at line 132 of file smpp_pdu.c.
References DEFAULT_SMSC_ID, dict_get(), name, octstr_imm(), smsc_id, and tlvs_by_name.
Definition at line 155 of file smpp_pdu.c.
References DEFAULT_SMSC_ID, dict_get(), octstr_destroy(), octstr_format(), octstr_imm(), smsc_id, smpp_tlv::tag, and tlvs_by_tag.
|
static |
Definition at line 89 of file smpp_pdu.c.
Referenced by smpp_pdu_init(), and smpp_pdu_shutdown().
|
static |
Definition at line 88 of file smpp_pdu.c.
Referenced by smpp_pdu_init(), smpp_pdu_shutdown(), and smpp_tlv_add_constant().
|
static |
Definition at line 87 of file smpp_pdu.c.
Referenced by smpp_pdu_init(), and smpp_tlv_add_constant().
|
static |
Definition at line 86 of file smpp_pdu.c.
Referenced by smpp_pdu_init(), smpp_pdu_shutdown(), and smpp_tlv_get_by_name().
|
static |
Definition at line 84 of file smpp_pdu.c.
Referenced by smpp_pdu_init(), smpp_pdu_shutdown(), and smpp_tlv_get_by_tag().