aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/sgsn_main.c
AgeCommit message (Collapse)AuthorFilesLines
2017-03-09sgsn init: pass sgsn_config pointer to sgsn_vty_init(), not sgsn_parse_configNeels Hofmeyr1-2/+2
It makes sense semantically, and prepares for an upcoming commit that uses the internal global config pointer in sgsn_vty_init(), which would not be defined yet without this. Change-Id: Ie4cf1c0a1c9e6330a134ff4b7b2e6d5699c12bd7
2017-03-09iu: sort out confusion around asn_debug and asn1_xer_printNeels Hofmeyr1-9/+0
Before, I confused asn_debug with asn1_xer_print. Have two distinct VTY commands and fix documentation. Put the asn_debug and asn1_xer_print implementations in iu.c. Since they are globally defined, don't pass a pointer to iu_vty_init() but just use it directly. Might be considered less clean, but is also less bloat. Change-Id: Iccbadfe1585ba224f74cdfb5273b5ce29b6d78f0
2017-02-27SGSN VTY: make missing GSUP server address+port fatalNeels Hofmeyr1-1/+1
On 'auth-policy remote', the SGSN requires GSUP server address and port. If it was missing, the SGSN would print a VTY warning and run anyway. Make this error more fatal: print an error (flattened a bit) to stderr and abort the program. Move validation of the GSUP server data presence out of the VTY command itself and into the config reading function. This way the GSUP server config can be given anywhere, including below the auth-policy config (was required above). Don't care about setting the auth-policy to remote with a telnet VTY, because in that case the GSUP client won't be started anyway. Change-Id: I4d8db910c32abd8579d3c9b9f0b2cb3a9a6dfe4c
2017-02-08vty: remove ignored logging parametersMax1-1/+1
Since ce9fec3e896571835ac5bfd2980d6836f2b29f0d libosmocore ignores parameters to log_vty_command_* functions. Hence parameter of logging_vty_add_cmds() is ignored too. As we depend on much later libosmocore version anyway, we can simplify code somewhat by removing parameters which will be ignored anyway. Change-Id: I62f752fd88f1d8fefa563648f9864c7c31f87991
2016-10-13msgb ctx: use new msgb_talloc_ctx_init(), don't access talloc_msgb_ctxNeels Hofmeyr1-2/+1
Drop extern definitions of talloc_msgb_ctx and use msgb_talloc_ctx_init() instead. In sgsn_test.c, use a local variable msgb_ctx to do the talloc report from the return value of msgb_talloc_ctx_init(). Change-Id: I2f9ace855f0ecbdc9adf5d75bcb1a3d666570de4
2016-09-30log CTRL bind only onceNeels Hofmeyr1-2/+0
After libosmocore 38d232ee5d2ceb045d9ad6d3a23afcb4972523f7 which outputs 'CTRL at <ip> <port>' from ctrl_interface_setup_dynip(), there's no need to log the CTRL bind here anymore. Change-Id: I1a874efe365a1ecf8ec37b058215b95b9a635ec2
2016-09-27log VTY telnet bind only onceNeels Hofmeyr1-2/+0
After libosmocore 55dc2edc89c1a85187ef8aafc09f7d922383231f which outputs 'telnet at <ip> <port>' from telnet_init_dynif(), there's no need to log the telnet VTY bind here anymore. Change-Id: I97a730b28759df1d549a5049f47a3da1c16a3447
2016-09-24SNDCP: add V.42bis data compression functionalityPhilipp1-0/+5
- Add compression control for V.42bis Add code to handle compression (gprs_sndcp_dcomp.c/h) - Add Adjustments in SNDCP - Add VTY commands Change-Id: I6d36cbdf2f5c5f83ca9ba57c70452f02b8582e7e
2016-09-24RFC1144: integration and unit-testPhilipp1-0/+5
The previously pushed slhc implementation has been modified to compile and function outside of the kernel. Also debug log messages were added and datatypes ware matched. The implementation is now ready to be used Change-Id: I7a638e88a43b3eb9d006751a03ef2570e36613f0
2016-09-01IuPS: osmo-sgsn: add core IuPS impl, call iu_init()Daniel Willmann1-0/+16
Add main Iu entry points for IuPS: * gsm0408_gprs_rcvmsg_iu() * sgsn_ranap_iu_event() * sgsn_ranap_rab_ass_resp() Add main MM context management for IuPS: * sgsn_mm_ctx_by_ue_ctx() * sgsn_mm_ctx_alloc_iu() Call iu_init() from sgsn_main.c. Add asn_debug impl ("extern" from libasn1c). Initialize asn_debug VTY command (iu_vty_init()). osmo-sgsn build: add libiu and libasn1c, libosmo-sigtran, libosmo-ranap Change-Id: I469ae6ca9ef254d04ee0d2d79bdd65aebcd027b5
2016-07-25sgsn: add statistics counter for GPRS and PDP packetsAlexander Couzens1-0/+1
Changing the test to allow still allocated block from the rate counters. Change-Id: Ie30e4c3084ee3a138d6b39bb5000234ac814e65f
2016-07-16SGSN: use unique AUTH REQ referenceMax1-0/+2
The A&C reference number specified in 3GPP TS 24.008 ยง 10.5.5.19 identifies particular request sent by network with the related response sent by MS. The value transparently copied from request to response by MS: the spec do not specify what exactly should be in there so we use rand() to decrease chance for collisions. Note: variable named 'rand' clashes with standard function rand() so it was renamed. Change-Id: I3638821a9b4a0532b28dbbb50faa30c4082579f6 Related: OS#1582
2016-06-13add DSUA debug constantDaniel Willmann1-0/+5
Change-Id: I4a3a8189564345700ea4825983ab39a8411227f4
2016-06-10add DRANAP debug constantDaniel Willmann1-0/+5
Change-Id: I6132198ea86979e0ed84df32f2b7117feba497f2
2016-02-25enable ctrl bind config for various programsNeels Hofmeyr1-11/+20
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-25enable telnet VTY bind address config for various programsNeels Hofmeyr1-3/+8
Following the 'line vty'/'bind A.B.C.D' command added in libosmocore, use the configured address to set the telnet bind for the VTY line. It is now possible to publish the VTY on a specific local interface (including 0.0.0.0 aka "any"). Implement in all of: osmo-gbproxy osmo-gtphub osmo-sgsn osmo-bsc osmo-bsc_nat osmo-bsc_mgcp osmo-nitb In some of these main programs, move the telnet initialization below the configuration parsing. Historically, this was not a good idea for programs using bsc_init.c (aka bsc_bootstrap_network()), since they expected a gsm_network struct pointer in ((struct telnet_connection*)vty->priv)->priv, so that telnet had to be either initialized or replaced by a dummy struct. In the meantime, the gsm_network struct is not actually looked up in a priv pointer but in the static bsc_vty.c scope (bsc_gsmnet), so this limitation is mere legacy (even though said legacy is still there in an "#if 0" chunk). In the other binaries I have briefly looked at the init sequence dependencies and found no reason to initialize telnet above the config file parsing. In any case, I have tested every single one of abovementioned binaries to verify that they still parse the example config successfully and launch, allowing VTY connections on the configured address(es). I hope this suffices. In all of the above, log VTY address and port. LOGL_INFO is disabled by default in some of the logging scopes, and since it is a single log message right at program launch, I decided for the slightly more aggressive LOGL_NOTICE.
2015-11-02stats: Enable stats for sgsn, gbproxy, nitb, bsc, natJacob Erlbeck1-1/+5
This commit initialises and enables the stats subsystem for the given binaries. Sponsored-by: On-Waves ehf
2015-10-29SGSN: Fix typo in VTY license statement.Harald Welte1-1/+1
It mentioned AGPLv3+ and refers to the hyperlink of v3, but still stated "Version 2 or later". That was a typo at the time.
2015-09-24sgsn_main: in -h, print default config fileNeels Hofmeyr1-1/+1
2015-09-24vty: Change the return type from enum to intHolger Hans Peter Freyther1-1/+1
clang complained that different enums are mixed with the return type and we actually want this to be an int now.
2015-05-25sgsn: Allow to resolve the IPv4 address of a GGSN through DNSHolger Hans Peter Freyther1-0/+8
For real networks we need to check if the requested APN string is allowed and then resolve the GGSN address through DNS. There are countries with two or three digit MNCs and one could either try to keep a list of countries that have two/three digits or just try both of them. I have opted for the later for the ease of the implementation. C-Ares doesn't allow to cancel a request so we will need to have the MMCTX and the Lookup have different lifetimes. We simply set ->mmctx to NULL in case the MMCTX dies more early. The selected and verified apn_str will be copied into the out parameter. In case no static APN/GGSN config is present and the dynamic mode is enabled a request will be made.
2015-05-06sgsn: Create an initial and limited CDR moduleHolger Hans Peter Freyther1-0/+1
This is consuming the new signals and allows to install several different CDR/observing/event/audit modules in the future. For getting the bytes in/out the code would have had to undo what the rate counter is doing and at the same time adding a "total" to the ratecounter didn't look like a good idea, the same went for making it a plain counter. Begin writing the values one by one and open/closing a new FILE for every log messages. This is not efficient but easily deals with external truncation/rotation of the file (no fstat for and checking the links and size). As usual we will wait and see if this is an issue. Add some new members to our PDP context structure to see what it is about.
2015-01-26sgsn: Remove inactive LLME/MM after inactivity timeoutJacob Erlbeck1-0/+1
Currently old LLMEs and MM contexts that haven't been explicitly detached or cancelled are not removed until another request with the same IMSI is made. These stale entries may accumulate over time and severely compromise the operation of the SGSN. This patch implements age based LLME expiry, when the maximum age has been reached, the corresponding MM context is cancelled. If such an MM context doesn't exist, the LLME is unassigned directly. The implementation works as follows. - llme->age_timestamp is reset on each received PTP LLC message - sgsn_llme_check_cb is invoked periodically (each 30s) - sgsn_llme_check_cb sets the age_timestamp to the current time if it has been reset - sgsn_llme_check_cb computes the age and expires the LLME if it exceeds gprs_max_time_to_idle() Ticket: OW#1364 Sponsored-by: On-Waves ehf [hfreyther: Fix typo in comment LMME -> LLME]
2015-01-18sgsn: Integrate the GSUP client into the SGSNJacob Erlbeck1-0/+6
This commit adds GSUP client configuration (via VTY), connection set up, and real message sending. The following configuration commands are added: - gsup remote-ip A.B.C.D set server IP address - gsup remote-port PORT set server TCP port Ticket: OW#1338 Sponsored-by: On-Waves ehf
2014-12-09sgsn: Add gprs_subscriber.cJacob Erlbeck1-3/+0
This patch adds GPRS specific functions for gsm_subscriber objects (allocation, retrieval, deletion) and subscriber data requests/updates. The sgsn_update_subscriber_data callback is used to notify the sgsn about updates and is extended by a parameter that passes a reference to a gsm_subscriber. Sponsored-by: On-Waves ehf
2014-11-14sgsn: Remove explicit sgsn_instance parametersJacob Erlbeck1-1/+1
Currently the function in sgsn_auth.c either have an sgsn_config or an sgsn_instance parameter. Since then global sgsn variable is already being used in that file and since other parts of the SGSN related code also rely on a global sgsn singleton, these parameters pretend to provide a flexibility that is not really supported. Therefore this patch removes these parameters except for the ACL related functions, which do not call code that uses the sgsn variable. Sponsored-by: On-Waves ehf
2014-11-14sgsn: Add 'acl-only' authentication policyJacob Erlbeck1-1/+1
Currently the VTY 'auth-policy' command results in setting or clearing the acl_enabled flag. This also enables the matching of the MCC/MNC prefix of the IMSI. This patch adds an additional policy 'acl-only' which disables the MCC/MNC matching and relies on the ACL only. Sponsored-by: On-Waves ehf
2014-10-27sgsn: Moved IMSI ACL management to sgsn_auth.cJacob Erlbeck1-0/+1
Currently the ACL code is located in sgsn_vty.c. This commit moves this to a new file sgsn_auth.c as a first step to make authorization more flexible in order to implement remote acquisition on subsciber data. Sponsored-by: On-Waves ehf
2014-08-24Use port number #defines for VTY and CTRL portsHarald Welte1-2/+4
.. as defined in libosmocore
2014-08-21move libctrl from openbsc to libosmoctrl (libosmocore.git)Harald Welte1-1/+1
2014-03-23sgsn/ctrl: Add ctrl interface, implement listing subscribersHolger Hans Peter Freyther1-0/+13
Add the control interface with no hierachy right now and implement the first command to list IMSI + Context Address of active sessions. sgsn_cmd_handle could share more code with bsc variant. Fixes: SYS#264, SYS#265
2013-07-21sgsn: add a minimalistic ACLHarald Welte1-0/+1
This adds a minimalistic ACL by which certain, individual roaming IMSIs can be authorized to use the SGSN. So you can selectively bypass the 'MCC+MNC == first 5 digits of IMSI' checking for a couple of IMSIs
2012-11-21sms: Use the DLSMS instead of the DSMS category throughout our codeHolger Hans Peter Freyther1-6/+0
2012-08-03gb: suspend_ref was changed to a plain uint8_t, update the codeHolger Hans Peter Freyther1-1/+1
Require a 0.5.2+ libosmogb due the change of the suspend_ref type.
2012-06-17libgb: make sure all BSSGP functions have bssgp_ prefixHarald Welte1-3/+3
We change the minority of functions employing the gprs_bssgp_ prefix to match with the majority without gprs_ in front.
2012-06-17libgb/gprs: don't use log_info from libcommon anymoreHarald Welte1-2/+66
2012-06-17libgb: don't call directly into GMM / LLC layerHarald Welte1-0/+29
Instead of direct function calls to individual functions, we now generate primitives (osmo_prim) and send them to one application-provided function "bssgp_prim_cb()"
2012-06-16libgb: Remove dependency to openbsc/debug.hHarald Welte1-0/+3
2012-06-16libgb: remove dependencies to openbsc/vty.h and openbsc/gsm_data.hHarald Welte1-1/+1
Rather than using openbsc internal data/functions, we now use only internal and libosmocore-provided ones.
2012-06-16libgb: Use library SS_L_NS instead lf local SS_NSHarald Welte1-1/+1
which removes some further dependencies of libgb to openbsc internal code and data.
2012-06-16split libgb into a separate library for outside useHarald Welte1-2/+3
This also removes the dependency to osmo_sock() inside libcommon and replaces it with osmo_sock_* from libosmocore
2012-03-01misc: Use msgb_free for freeing the messagesHolger Hans Peter Freyther1-1/+1
2011-10-14gprs: Fix compiler warnings in the codeHolger Hans Peter Freyther1-2/+0
2011-08-19src: port openBSC over libosmo-abis0.9.15Pablo Neira Ayuso1-1/+1
This is a big patch that ports openBSC over libosmo-abis. Sorry, the changes that are included here are all dependent of libosmo-abis, splitting them into smaller pieces would leave the repository in some intermediate state, which is not desired. The main changes are: - The directory libabis/ has been removed as it now lives in libosmo-abis. - new configuration file format for nanoBTS and HSL femto, we need to define the virtual e1_line and attach it to the OML link. - all the existing BTS drivers (nanoBTS, hsl femto, Nokia site, BS11 and rbs2000) now use the new libosmo-abis framework. - use r232 input driver available in libosmo-abis for bs11_config. - use ipa_msg_recv instead of old ipaccess_read_msg function. - delete definition of gsm_e1_subslot and input_signal_data. These structures now lives in libosmo-abis. Most of this patch are deletions of libabis/ which has been moved to libosmo-abis. This patch also modifies openBSC to use all the new definitions available in libosmocore and libosmo-abis. In order to do that, we have replaced the following: - DINP, DMI, DMIB and DMUX by their respective DL* correspondences. - SS_GLOBAL by SS_L_GLOBAL - SS_INPUT by SS_L_INPUT - S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN - SS_INPUT by SS_L_INPUT - S_INP_* by S_L_INP_* sub-signals - E1INP_NODE by L_E1INP_NODE vty node This patch has been tested with: - one nanoBTS - the HSL femto with the examples available under libosmo-abis - BS11 with both dahdi and misdn drivers.
2011-07-16sgsn_main: add comment about exit statement never reachedHarald Welte1-0/+1
2011-05-12misc: Use the osmo_init code for signals and loggingHolger Hans Peter Freyther1-10/+7
Use the libosmocore code to ignore certain signals by default (e.g. SIGHUP, SIGPIPE) and use the new code to create a default stderr logging target and initialize it properly.
2011-05-06src: use namespace prefix osmo_signal*Pablo Neira Ayuso1-1/+1
Summary of changes: s/signal_cbfn/osmo_signal_cbfn/g s/register_signal_handler/osmo_signal_register_handler/g s/unregister_signal_handler/osmo_signal_unregister_handler/g s/dispatch_signal/osmo_signal_dispatch/g
2011-05-06src: use namespace prefix osmo_fd* and osmo_select*Pablo Neira Ayuso1-1/+1
Summary of changes: s/struct bsc_fd/struct osmo_fd/g s/bsc_register_fd/osmo_fd_register/g s/bsc_unregister_fd/osmo_fd_unregister/g s/bsc_select_main/osmo_select_main/g
2011-04-18misc: Remove sys/types.h includes from the filesHolger Hans Peter Freyther1-1/+0
These are not needed any more. We used them for u_int types but we now use uint which comes from stdint.h
2011-04-18misc: Move from u_int to uint types of stdint.hHolger Hans Peter Freyther1-1/+1
This was done with sed on the files.