blob: cc0e8003a190ff9d81005bd852a2d39c81e8642c [file] [log] [blame]
Max5346f692022-07-28 14:19:22 +07001#pragma once
2
3#include <osmocom/msc/gsm_data.h>
4
5/* Length limits according to SMPP 3.4 spec including NUL-byte: */
6#define SMPP_SYS_ID_LEN 15
7#define SMPP_PASSWD_LEN 8
8
9enum esme_read_state {
10 READ_ST_IN_LEN = 0,
11 READ_ST_IN_MSG = 1,
12};
13
14/*! \brief Ugly wrapper. libsmpp34 should do this itself! */
15#define SMPP34_UNPACK(rc, type, str, data, len) { \
16 memset(str, 0, sizeof(*str)); \
17 rc = smpp34_unpack(type, str, data, len); }
18
19#define PACK_AND_SEND(esme, ptr) pack_and_send(esme, (ptr)->command_id, ptr)
20
21/*! \brief initialize the libsmpp34 data structure for a response */
22#define INIT_RESP(type, resp, req) { \
23 memset((resp), 0, sizeof(*(resp))); \
24 (resp)->command_length = 0; \
25 (resp)->command_id = type; \
26 (resp)->command_status = ESME_ROK; \
27 (resp)->sequence_number = (req)->sequence_number; }
28
29uint32_t smpp_msgb_cmdid(struct msgb *msg);
30int smpp_openbsc_alloc_init(void *ctx);
31int smpp_openbsc_start(struct gsm_network *net);