aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2022-11-21 16:28:48 +0300
committerMax <msuraev@sysmocom.de>2022-11-21 16:31:05 +0300
commit634591e85b3cd3b7871c59652be31d317560f23a (patch)
tree1512c1b2153df394721e70bbeebf8abc5f7639d4
parent40d34978770c5264d7e29a60f33f21c7891f0905 (diff)
SMPP: make smpp_smsc_stop() staticHEADmaster
It's only used in a single file so there's no point exposing it via header. Related: OS#5568 Change-Id: I3d0d850ffe6ebf9d623c1f250d4293a3c427d5d8
-rw-r--r--include/osmocom/smpp/smpp_smsc.h1
-rw-r--r--src/libsmpputil/smpp_smsc.c20
2 files changed, 10 insertions, 11 deletions
diff --git a/include/osmocom/smpp/smpp_smsc.h b/include/osmocom/smpp/smpp_smsc.h
index 960707936..6d7647589 100644
--- a/include/osmocom/smpp/smpp_smsc.h
+++ b/include/osmocom/smpp/smpp_smsc.h
@@ -107,7 +107,6 @@ struct smsc *smpp_smsc_alloc_init(void *ctx);
int smpp_smsc_conf(struct smsc *smsc, const char *bind_addr, uint16_t port);
int smpp_smsc_start(struct smsc *smsc, const char *bind_addr, uint16_t port);
int smpp_smsc_restart(struct smsc *smsc, const char *bind_addr, uint16_t port);
-void smpp_smsc_stop(struct smsc *smsc);
void smpp_esme_get(struct smpp_esme *esme);
void smpp_esme_put(struct smpp_esme *esme);
diff --git a/src/libsmpputil/smpp_smsc.c b/src/libsmpputil/smpp_smsc.c
index 0ee5b62d8..d54b3c119 100644
--- a/src/libsmpputil/smpp_smsc.c
+++ b/src/libsmpputil/smpp_smsc.c
@@ -966,6 +966,16 @@ int smpp_smsc_conf(struct smsc *smsc, const char *bind_addr, uint16_t port)
return 0;
}
+/*! /brief Close SMPP connection. */
+static void smpp_smsc_stop(struct smsc *smsc)
+{
+ if (smsc->listen_ofd.fd > 0) {
+ close(smsc->listen_ofd.fd);
+ smsc->listen_ofd.fd = 0;
+ osmo_fd_unregister(&smsc->listen_ofd);
+ }
+}
+
/*! \brief Bind to given address and port and accept connections.
* \param[in] bind_addr Local IP address, may be NULL for any.
* \param[in] port TCP port number, may be 0 for default SMPP (2775).
@@ -1004,13 +1014,3 @@ int smpp_smsc_restart(struct smsc *smsc, const char *bind_addr, uint16_t port)
return smpp_smsc_start(smsc, smsc->bind_addr, smsc->listen_port);
return 0;
}
-
-/*! /brief Close SMPP connection. */
-void smpp_smsc_stop(struct smsc *smsc)
-{
- if (smsc->listen_ofd.fd > 0) {
- close(smsc->listen_ofd.fd);
- smsc->listen_ofd.fd = 0;
- osmo_fd_unregister(&smsc->listen_ofd);
- }
-}