osmo-msc/openbsc/src/libmsc
Neels Hofmeyr 1b0e5540db smpp: refactor initialization, add bind address
Make the SMPP bind address configurable (used to be harcoded as "0.0.0.0").

Add VTY command

    smpp
     local-tcp A.B.C.D <1-65535>

while keeping the old command 'local-tcp-port <1-65535>'. Both the old and the
new command immediately change the SMPP listening address and port.

Add a LOGL_NOTICE log when the SMPP listening address and/or port change.

However, to be useful, this patch has to go somewhat further: refactor the
initialization procedure, because it was impossible to run the VTY commands
without an already established connection.

The SMPP initialization procedure was weird. It would first open a connection
on the default port, and a subsequent VTY port reconfiguration while reading
the config file would try to re-establish a connection on a different port. If
that failed, smpp would switch back to the default port instead of failing the
program launch as the user would expect. If anything else ran on port 2775,
SMPP would thus refuse to launch despite the config file having a different
port: the first bind would always happen on 0.0.0.0:2775. Change that.

In the VTY commands, merely store address and port if no fd is established yet.

Introduce several SMPP initialization stages:

* allocate struct and initialize pointers,
* then read config file without immediately starting to listen,
* and once the main program is ready, start listening.

After that, the VTY command behaves as before: try to re-establish the old
connection if the newly supplied address and port don't work out. I'm not
actually sure why this switch-back behavior is needed, but fair enough.

In detail, replace the function
  smpp_smsc_init()
with the various steps
  smpp_smsc_alloc_init() -- prepare struct for VTY commands
  smpp_smsc_conf() -- set addr an port only, for reading the config file
  smpp_smsc_start() -- establish a first connection, for main()
  smpp_smsc_restart() -- switch running connection, for telnet VTY
  smpp_smsc_stop() -- tear down connection, used by _start() twice

And replace
  smpp_openbsc_init()
  smpp_openbsc_set_net()
with
  smpp_openbsc_alloc_init()
  smpp_openbsc_start()

I'd have picked function names like "_bind"/"_unbind", but in the SMPP protocol
there is also a bind/unbind process, so instead I chose the names "_start",
"_restart" and "_stop".

The smsc struct used to be talloc'd outside of smpp_smsc_init(). Since the smsc
code internally uses talloc anyway and employs the smsc struct as talloc
context, I decided to enforce talloc allocation within smpp_smsc_alloc_init().

Be stricter about osmo_signal_register_handler() return codes.
2016-02-25 12:18:04 +01:00
..
Makefile.am Patch to make openbsc find libsmpp34 2016-02-18 19:39:32 +01:00
auth.c libmsc: Use RAND_bytes to choose auth tuple 2015-10-12 09:06:59 +02:00
ctrl_commands.c msc: Add and use gsm_subscriber_group 2014-12-05 14:59:02 +01:00
db.c db: Avoid undefined behavior when copying cm2/cm3 from the db 2016-01-23 09:21:04 +01:00
gsm_04_08.c gsm0408: Provide unique strings for the gsm 04.08 message 2016-01-30 09:57:49 +01:00
gsm_04_11.c gsm340_rx_tpdu: comment-out two unused vars 2016-02-25 12:18:03 +01:00
gsm_04_11_helper.c sms: Increment the RP Message Reference for each transaction 2014-02-20 11:35:56 +01:00
gsm_04_80.c gsm0408: Provide unique strings for the gsm 04.08 message 2016-01-30 09:57:49 +01:00
gsm_subscriber.c subscr: Fix potential subscr ref count issue 2015-08-08 20:46:49 +02:00
meas_feed.c msc: Add channel information to the meas_feed, bump version to v1. 2015-09-14 10:08:41 +02:00
meas_feed.h Initial support for export + curses-visualization of measurements 2015-01-01 13:03:03 +01:00
mncc.c mncc.c: Convert mncc_names[] to 'struct value_string' 2015-12-12 21:43:16 +01:00
mncc_builtin.c mncc: introduce 'struct gsm_mncc_bridge' for MNCC_BRIDGE 2015-12-12 21:43:16 +01:00
mncc_sock.c osmo-nitb: add -M to pass specific MNCC socket path 2016-02-25 12:18:03 +01:00
osmo_msc.c msc: Remove oversimplified todo entry and add a comment 2016-02-10 10:42:20 +01:00
rrlp.c src: use namespace prefix osmo_signal* 2011-05-06 12:12:31 +02:00
silent_call.c paging: Move the silent_call code to use the subscriber request 2015-08-03 12:02:14 +02:00
smpp_openbsc.c smpp: refactor initialization, add bind address 2016-02-25 12:18:04 +01:00
smpp_smsc.c smpp: refactor initialization, add bind address 2016-02-25 12:18:04 +01:00
smpp_smsc.h smpp: refactor initialization, add bind address 2016-02-25 12:18:04 +01:00
smpp_utils.c smpp: Move the coding/mode detection into a utils file 2013-07-27 20:03:10 +02:00
smpp_vty.c smpp: refactor initialization, add bind address 2016-02-25 12:18:04 +01:00
sms_queue.c SMS: Attempting to send SMS is not a NOTICEable event 2015-01-05 14:05:32 +01:00
token_auth.c msc: Add and use gsm_subscriber_group 2014-12-05 14:59:02 +01:00
transaction.c sub: Remove the queue from the subscriber code 2015-04-29 18:53:28 +02:00
ussd.c ussd: Reject and release unhandled SS requests/interrogation 2013-12-28 17:52:23 +01:00
vty_interface_layer3.c paging: Provide information about pending requests 2015-08-08 20:49:04 +02:00