aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc/smpp_smsc.h
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-11-08 16:14:37 +0100
committerHarald Welte <laforge@gnumonks.org>2012-11-16 22:00:09 +0100
commitf1033cc752cfeb5f86e6f2357ce62637646f773f (patch)
tree6f1e6c58a5953a1c5d055fd1b4deb48cb98388e7 /openbsc/src/libmsc/smpp_smsc.h
parent90d7f26f67e042205baa576659605df333033333 (diff)
Initial support of SMPP interface for MT-SMS
Diffstat (limited to 'openbsc/src/libmsc/smpp_smsc.h')
-rw-r--r--openbsc/src/libmsc/smpp_smsc.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/smpp_smsc.h b/openbsc/src/libmsc/smpp_smsc.h
new file mode 100644
index 000000000..500fbc35a
--- /dev/null
+++ b/openbsc/src/libmsc/smpp_smsc.h
@@ -0,0 +1,52 @@
+#ifndef _SMPP_SMSC_H
+#define _SMPP_SMSC_H
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+
+#include <osmocom/core/utils.h>
+#include <osmocom/core/msgb.h>
+#include <osmocom/core/write_queue.h>
+
+#include <smpp34.h>
+#include <smpp34_structs.h>
+#include <smpp34_params.h>
+
+enum esme_read_state {
+ READ_ST_IN_LEN = 0,
+ READ_ST_IN_MSG = 1,
+};
+
+struct osmo_esme {
+ struct llist_head list;
+ struct smsc *smsc;
+
+ struct osmo_wqueue wqueue;
+ struct sockaddr_storage sa;
+ socklen_t sa_len;
+
+ enum esme_read_state read_state;
+ uint32_t read_len;
+ uint32_t read_idx;
+ struct msgb *read_msg;
+
+ uint8_t smpp_version;
+ char system_id[16+1];
+
+ uint8_t bind_flags;
+};
+
+struct smsc {
+ struct osmo_fd listen_ofd;
+ struct llist_head esme_list;
+ char system_id[16+1];
+ void *priv;
+};
+
+
+int smpp_smsc_init(struct smsc *smsc, uint16_t port);
+
+int handle_smpp_submit(struct osmo_esme *esme, struct submit_sm_t *submit,
+ struct submit_sm_resp_t *submit_r);
+
+#endif