aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include
AgeCommit message (Collapse)AuthorFilesLines
2016-03-03mscsplit: getting grips on header scopesNeels Hofmeyr3-10/+35
2016-03-03msc: clarify msc_api and msc_ifaces scopesNeels Hofmeyr1-12/+17
2016-03-03rename IFACE_IUCS to IFACE_IUNeels Hofmeyr1-3/+3
2016-03-03cscn: rename msc_apiNeels Hofmeyr1-0/+31
2016-03-03cscn wip: direct dtap responses to IuCSNeels Hofmeyr1-1/+4
2016-03-03introduce vty CSCN_NODE, cosmetically.Neels Hofmeyr1-0/+1
2016-03-03mscplit: try to clarify root talloc ctx and global gsm_network.Neels Hofmeyr4-4/+19
The aim is to allow osmo-cscn to pass its own root talloc context and global gsm_network struct instance cleanly. This may stir up some old and dusty globals, but I hope it's for the better, since not all is a BSC. To ensure that a global gsm_network pointer for the bsc_vty is set, have it as argument to bsc_vty_init(). The vty configuration commands are added only after bsc_vty_init(), which are needed to configure the network struct. So split up the bsc_bootstrap_network() function into bsc_network_init() to allocate a gsm_struct, and bsc_network_configure() to read the config file once the vty commands are in place. In this way, no global bsc_gsmnet pointer is needed for the bsc vty. The atomic super glue is dissolved and osmo-cscn will be allowed to have a different name for it. Admitted, it's still called the bsc_vty, but a split thereof is probably coming soon, because the CSCN doesn't want any of the BSC nor BTS specific vty commands.
2016-03-03mscsplit: remove bts and lchan pointers from libmscNeels Hofmeyr7-35/+62
The diff between this and master will probably need a lot of review and fixes. The current state does compile, but I expect pretty much everything to be broken now. Future development will reinstate proper functionality piecemeal. The first goal is to get basic signalling to work, then SMS. The voice control (RTP) is completely disabled now (see "#if BEFORE_MSCSPLIT") and will be fixed last AFAICT.
2016-03-03cscn: call msc_compl_l3() from subscr_conn_allocate_iu()Neels Hofmeyr1-2/+4
Pubish msc_compl_l3() decl in new file libmsc/msc_api.h (but see comment). Call msc_compl_l3() when establishing a subscriber connection for IuCS. Remove bts from subscr_conn_allocate_iu() signature, use network, link_id and conn_id instead. Move subscr_conn_allocate_iu() to the top of the file, because it semantically belongs before subscr_conn_lookup_iu().
2016-03-03cscn: move gsm0408_rcvmsg_iucs() decl to proper place.Neels Hofmeyr1-3/+0
Add noinst-header iu_cs.h and move the gsm0408_rcvmsg_iucs() declaration there.
2016-03-03put Iu-common and Iu-CS stuff in proper placesNeels Hofmeyr2-1/+6
Add libiu to contain the parts used by both Iu-CS (in osmo-cscn) and Iu-PS (in gprs) into libiu. It's rather thin and may make sense to move to osmo-iuh altogether, eventually. iu.c is half moved to libiu/, and half to osmo-cscn/iu_cs.c.
2016-03-03func declaration, commentsNeels Hofmeyr1-0/+2
2016-03-03fix: it's called msgb.dst.Neels Hofmeyr1-1/+1
2016-03-03cosmetic: a rename, comments.Neels Hofmeyr2-1/+2
Rename conn_ctx_list -> ue_conn_ctx_list. Indicate Iu-CS 'siblings' for a couple of functions. Tweak/add comments.
2016-03-03Add Iu-CS indicator to struct gsm_subscriber_connection.Neels Hofmeyr1-0/+14
Introduce enum interface_type and gsm_subscriber_connection.via_iface to distinguish between A-interface and Iu-CS-interface connections. Add gsm_subscriber_connection.iu.link_id and iu.conn_id.
2016-03-03iu_init: add addr and port argsNeels Hofmeyr1-1/+2
2016-03-03add DIUCS debug idNeels Hofmeyr1-0/+1
2016-03-03various small fixesNeels Hofmeyr1-0/+3
2016-03-03sai arg back to pointerNeels Hofmeyr1-1/+1
2016-03-03generalize rab_act for ps and csNeels Hofmeyr1-0/+3
2016-03-03move struct ue_conn_ctx to headerNeels Hofmeyr1-0/+6
2016-03-03sai argNeels Hofmeyr1-1/+1
2016-03-03tweak ..rcvmsg_iu()'s sai arg.Neels Hofmeyr2-2/+3
It was a uint16_t*, but is passed as a uint16_t, and never used anyway, yet.
2016-03-03iu_common wipNeels Hofmeyr3-1/+13
2016-03-03migrate WIP osmo-iuh hack to use system-installed libosm-ranap.soHarald Welte1-0/+2
this means we no longer try to link to hard-coded files outside of the openbsc.git repository.
2016-03-03WIP: Really ugly hacks to get up to (and including) PDP CTX ACTHarald Welte1-0/+4
2016-03-03rename gsm0408_gprs_rcvmsg() to gsm0408_gprs_rcvmsg_gb()Harald Welte1-1/+1
This is the entry point for GMM from Gb. We will create a new one for Iu, so let's be explicit rather than implicit.
2016-03-03prepare sgsn_mm_ctx for Gb and Iu mode (UMTS)Harald Welte1-11/+50
Let's explicitly mark those sgsn_mm_ctx members that apply for Gb mode and (upcoming) Iu mode, respectively.
2016-03-03move subscriber conns list into struct gsm_network.Neels Hofmeyr2-2/+3
Replace the global sub_connections llist with gsm_network.subscr_conns. Initialize and apply where applicable. Remove bsc_api_sub_connections().
2016-02-25smpp: refactor initialization, add bind addressNeels Hofmeyr1-2/+2
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-25enable ctrl bind config for various programsNeels Hofmeyr3-3/+6
Add ctrl_vty_init() calls and feed the ctrl_vty_get_bind_addr() return value to ctrl_interface_setup() in the following programs: osmo-bsc osmo-bsc_nat osmo-nitb osmo-sgsn For osmo-sgsn, move the control interface setup invocation below the config parsing, so that the ctrl_vty_get_bind_addr() can return the configured address.
2016-02-25osmo-nitb: add -M to pass specific MNCC socket pathNeels Hofmeyr1-1/+1
The old -m option without argument is still available and marked deprecated, to not make users' lives more difficult than necessary.
2016-02-22sgsn: Re-add searching for MM ctx based on TLLI / P-TMSI matchesJacob Erlbeck1-0/+4
If an MM context cannot be found based on BBSGP info and a RA UPDATE REQUEST is received, try to find an MM context with an P-TMSI from which the TLLI could have been derived. This also checks, whether the routing area matches. This is similar to the old behaviour removed by the commits "sgsn: Only look at TLLIs in sgsn_mm_ctx_by_tlli" and "sgsn: Remove tlli_foreign2local", except that this will only be done for RA UPDATE REQUESTs now. Sponsored-by: On-Waves ehf
2016-02-22sgsn: Make ra_id_equals available as gprs_ra_id_equalsJacob Erlbeck1-0/+2
The function is moved to gprs_utils.c, renamed, and made non-static to be usable in other modules, too. Sponsored-by: On-Waves ehf
2016-01-30gsm0408: Provide unique strings for the gsm 04.08 messageHolger Hans Peter Freyther1-2/+2
At Rhizomatica we see that some GSM 04.08 messages are leaked and have no other indication if that is Call Control, SMS or something else.
2015-12-12mncc: introduce 'struct gsm_mncc_bridge' for MNCC_BRIDGEHarald Welte1-0/+5
When a MNCC handler wants to issue the MNCC_BRIDGE primitive overt the MNCC interface, this was not possible so far via the MNCC socket. This primitive was so far only available from the internal MNCC handler, more or less by accident I suppose. The reason for this is in the way the array of two call references had been passed into mncc_tx_to_cc().
2015-12-12mncc.c: Convert mncc_names[] to 'struct value_string'Harald Welte1-1/+1
2015-12-07gtphub: simplify/fix: one TEI mapping per tunnel.Neels Hofmeyr1-1/+1
Because the sender is known, one unique TEI per tunnel suffices to map the TEIs that the peers are sending to gtphub, instead of previously 4 (SGSN<->GGSN interaction on User and Ctrl plane, where each had an own unique TEI). Also, previously, a tunnel's endpoints should also have been checked against each other for TEI reuse, not only against the endpoints of other tunnels. This simplification fixes that problem for free. Thus simplify TEI reuse detection and improve VTY show readability and debugging. Adjust log and VTY output for tunnels. Adjust tests accordingly. Suggested-by: Holger Hans Peter Freyther <holger@moiji-mobile.com> Sponsored-by: On-Waves ehi
2015-12-07gtphub: add more detailed I/O rate counters.Neels Hofmeyr1-0/+4
Count bytes and packets per peer port, as well es per tunnel enpoint, which adds two more levels of detail. Sponsored-by: On-Waves ehi
2015-12-05gsm_data_shared: compute/sprintf the lchan name only onceHarald Welte1-1/+7
We now store the pre-printed lchan name in lchan->name to avoid having to call sprintf every time there is a debug statement somewhere, particularly as most of those debug statements are going to be inactive most of the time.
2015-12-03gtphub: implement sgsn_use_sender for NAT.Neels Hofmeyr1-0/+3
If an SGSN is behind NAT, we cannot rely on the default ports. Specifically, if a GGSN sends a message, the forwarding to the SGSN should go to whichever port the SGSN last sent from (whether sequence nr is known or not). Add sgsn_use_sender config and VTY command, and store the sender instead of the GSN Address IE and default port if set. Sponsored-by: On-Waves ehi
2015-12-03gtphub: wrap gtphub_write() for test suite.Neels Hofmeyr1-0/+4
Sponsored-by: On-Waves ehi
2015-12-03gtphub: monitor GSNs' restart counters.Neels Hofmeyr1-1/+2
If a GSN indicates that it has reset, tear down each known tunnel for that GSN individually (don't send the GSNs on the other side a different restart counter, because they represent more than just this GSN). Sponsored-by: On-Waves ehi
2015-12-03gtphub: handle Delete PDP Context.Neels Hofmeyr1-0/+1
During resolution of the header TEI, also return the tunnel struct that resolved the TEI, so the Delete PDP Ctx code does not need to look it up again. Upon Delete PDP Ctx Request, remember the IEs and that a request was made. Upon Delete PDP Ctx Response, find the pending delete and remove the corresponding tunnel, iff the response indicates success. Add a context deletion to regression tests, rename the test appropriately. Sponsored-by: On-Waves ehi
2015-12-03gtphub: fix some style complaints from cppcheckNeels Hofmeyr1-2/+0
Sponsored-by: On-Waves ehi
2015-12-03gtphub: refactor: use side_idx everywhere.Neels Hofmeyr1-32/+19
This is a mostly cosmetic change. Instead of separate buffer handling functions, reduce some code duplication by using a side_idx just like the plane_idx, with arrays. Sponsored-by: On-Waves ehi
2015-12-03gtphub: use a single TEI pool across planes.Neels Hofmeyr1-1/+1
There's no need to keep two separate number pools when both can be fed from the same pool. User and Ctrl plane TEIs can technically overlap without colliding, but it doesn't hurt if they don't overlap, either. Sponsored-by: On-Waves ehi
2015-12-03gtphub: cosmetic: for_each_side,_plane macros.Neels Hofmeyr1-0/+4
Simplify looping over sides and planes. I'm tired of typing the same for loops all the time. Sponsored-by: On-Waves ehi
2015-12-03gtphub: implement restart counter properly.Neels Hofmeyr1-2/+3
Force passing a restart counter, by adding such arg to gtphub_start() (test suite is not affected by this). In gtphub_main.c, add -r,--restart-file <path> and next_restart_count() to maintain the counter file. While at it, tweak the cmdline help to unify the formatting (mostly commas and a missing line break). Send gtphub's own restart counter. So far, the sender's restart counter was copied through, which would break as soon as more than one GSN would talk to the same peer with differing restart counters. Also fix the in-mem restart counter data type (one octet, not two). Sponsored-by: On-Waves ehi
2015-12-03gtphub: track tunnels explicitly.Neels Hofmeyr1-1/+32
So far, gtphub worked perfectly by only tracking single TEIs ... for probably most uses. But a Ctrl plane tunnel may have expired despite a still active corresponding User plane tunnel. The User plane would continue to work indefinitely, but if any Ctrl messages followed after more than six hours of Ctrl silence, they would have been dropped due to an expired TEI mapping. We want to - combine expiry of a user TEI with its ctrl TEI. (done in this patch) - upon delete PDP context, remove both user and ctrl TEI mappings. (future) - when a peer indicates a restart counter bump, invalidate its tunnels. (future) To facilitate these, track tunnels, complete with both SGSN's and GGSN's address, original and replaced TEIs, all for both user and ctrl plane, in a single struct. A single expiry entry handles the entire tunnel, instead of previously four separate expiries for each endpoint identifier. Add the concept of a "side", being either GGSN or SGSN, to index tunnel endpoint structs, and so on. Track the originating side in the gtp_packet_desc. Add header_tei_rx: set_tei() overwrites header_tei, but the originally received header TEI is still needed to match a Create PDP Context Response up with its Request (and for logging). Adjust the test suite to expect tunnel listing strings instead of TEI mappings, with a bonus of making it a lot easier to grok, and including the IP addresses. Add regression test for refreshing tunnel expiry upon use. Note: the current implementation is as slow as can possibly be, iterating all the tunnels all the time. Optimizations are kept for a future commit, on purpose. BTW, the sequence number mapping/unmapping structures remain unchanged. Sponsored-by: On-Waves ehi