openbsc.git branch neels/bind updated. 0.15.0-179-g7597337

gitosis at osmocom.org gitosis at osmocom.org
Wed Feb 24 19:45:51 UTC 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The OpenBSC GSM Base Station Controller (+MSC/HLR/SGSN)".

The branch, neels/bind has been updated
  discards  b95a6113acc0d4372d000c29a37592d9b80b8f1c (commit)
       via  7597337ddf523f5b95c8d8d2b8ba56c4caaf759a (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (b95a6113acc0d4372d000c29a37592d9b80b8f1c)
            \
             N -- N -- N (7597337ddf523f5b95c8d8d2b8ba56c4caaf759a)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cgit.osmocom.org/openbsc/commit/?id=7597337ddf523f5b95c8d8d2b8ba56c4caaf759a

commit 7597337ddf523f5b95c8d8d2b8ba56c4caaf759a
Author: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Date:   Wed Feb 24 19:15:39 2016 +0100

    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.

-----------------------------------------------------------------------

Summary of changes:
 openbsc/src/libmsc/smpp_smsc.c | 3 +++
 1 file changed, 3 insertions(+)


hooks/post-receive
-- 
The OpenBSC GSM Base Station Controller (+MSC/HLR/SGSN)



More information about the osmocom-commitlog mailing list