aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs
AgeCommit message (Collapse)AuthorFilesLines
2018-01-07gprs_gmm: Remove unused variablePau Espin Pedrol1-2/+2
Fixes following compilation warning: osmo-sgsn/src/gprs/gprs_gmm.c: In function ‘gsm48_rx_gmm_service_req’: osmo-sgsn/src/gprs/gprs_gmm.c:1786:10: warning: variable ‘ciph_seq_nr’ set but not used [-Wunused-but-set-variable] uint8_t ciph_seq_nr, service_type, mi_len, mi_type; ^~~~~~~~~~~ Change-Id: If0819026a99f45df96ee6de26a71c16128e79cb8
2017-12-27Migrate from OpenSSL to osmo_get_rand_id()Max5-38/+38
This avoids potential licensing incompatibility and makes integration of Debian packaging patches easier. The libosmocore version requirements are fine already but for jenkins tests to pass we have to have Ic77866ce65acf524b768882c751a4f9c0635740b merged into libosmocore master. Related: OS#1694 Change-Id: I2b687b7f07ef05bbd861b8479cad5a958a3dde92
2017-12-26Use connection id when allocating rate countersMax1-3/+5
Due to recent libosmocore's change we can't allocate rate counters with the same name and index which are already allocated. This causes sgsn_mm_ctx_alloc_iu() failure for multiple subscribers. Fix this by using conn_id parameter from ranap_ue_conn_ctx. Change-Id: I1062ffdcac96c82269cab6f4e7ae50e28dc3aa44 Related: OS#2757
2017-12-26cosmetic: use macro for gtphub plane iterationMax1-1/+1
Change-Id: If82fcd9f6509da60e6f0d916fe107de1b38bfd18
2017-12-20Remove dead codeMax1-4/+0
Get rid of ifdefs around old unused code to improve readability. Change-Id: Ia80cf845b624d520d67143b61c9de3d49074cb8c
2017-12-20Replace '.' in counter names with ':'Max3-3/+3
The '.' is illegal character in counter names, as they are exported via CTRL interface, where '.' has a special meaning that cannot be used by strings comprising the variable name. Change-Id: I4eb6851d3577f5942ae1a9ab28d3b3ca7ab8e208
2017-12-20gsm48_rx_gmm_att_req: fix error handling: don't clean up NULL llmeNeels Hofmeyr1-1/+1
Change-Id: I78903d0846568d4e98b6e43e62bbe3c329b5bc68
2017-12-20gprs_gmm: segfault: gracefully handle failure to alloc contextNeels Hofmeyr1-0/+4
This counter allocation error I hit uncovers a segfault when allocating an MM context fails in the GSM_MI_TYPE_TMSI case: DRANAP <001a> ../../../src/osmo-iuh/src/iu_client.c:509 handle_co_initial(dir=1, proc=19) DRANAP <001a> ../../../src/osmo-iuh/src/iu_client.c:229 RNC 23: new LAC 24358 RAC 22 DMM <0002> ../../../../src/osmo-sgsn/src/gprs/gprs_gmm.c:1271 MM(---/ffffffff) -> GMM ATTACH REQUEST MI(3427325924) type="GPRS attach" DLGLOBAL <001d> ../../../src/libosmocore/src/rate_ctr.c:195 counter group 'sgsn:mmctx' already exists for index 0 DMM <0002> ../../../../src/osmo-sgsn/src/gprs/gprs_sgsn.c:272 MM(/00000000) Cannot allocate counter group Program received signal SIGSEGV, Segmentation fault. gsm48_rx_gmm_att_req (llme=0x0, msg=0x555555886950, ctx=0x0) at ../../../../src/osmo-sgsn/src/gprs/gprs_gmm.c:1375 1375 ctx->p_tmsi = tmsi; Fix it with a bit of code already present for the GSM_MI_TYPE_IMSI case just above the segfault. Change-Id: I49aa95b610f2faec52dede2e4816da47ca1dfb14
2017-12-05Show GTP version for PDP context in vtyMax1-2/+2
Change-Id: Id1692e99ae0d2b78e9473f6139e6e430fcd6a607
2017-12-05Fix display of GTP addressesMax1-5/+5
Previously we've tried to convert addresses manually which lead to wrongly displayed GTP addresses (e. g. '4.0.0.0' instead of '127.0.0.2'). Use libgtp function for conversion to fix it. Change-Id: I695a9c9497d675564a088b002299096e0dcd267d
2017-11-29Add vty cmd 'cdr trap' to send CDR through CTRL ifacePau Espin Pedrol3-27/+69
Default behavior is to have them disabled, and can be explicitly disabled too by using 'no cdr trap' cmd. Tested with osmo_ctrl.py that messages are send successfully: TRAP 0 cdr-v1 20171129125950222,901700000015254,357737055592090,555,0,5,,pdp-periodic,2731,127.0.0.2,127.0.0.1,internet,176.16.222.3,20793,10045,1 Related: OS#2360 Change-Id: I1d144d87effd934d991257a65e19cf046a938907
2017-11-29sgsn_cdr: Split log formatting into a snprintf functionPau Espin Pedrol1-30/+51
This function is going to be re-used to send TRAP messages over CTRL interface. Related: OS#2360 Change-Id: I0d87df578db1d8c220fd63376e03866895d2aa0d
2017-11-28Replace '.' in counter names with ':'Pau Espin Pedrol1-14/+14
'.' is an illegal character in counter names, as they are exported via CTRL interface, where '.' has a special meaning that cannot be used by strings comprising the variable name. Change-Id: Ie7734cc42151581897d220b445984448ceb57aed
2017-11-24use default point-code as listed on Point_Codes wiki pageNeels Hofmeyr1-1/+2
see https://osmocom.org/projects/cellular-infrastructure/wiki/Point_Codes Change-Id: Ie11f1dfcdd5889d44fefe6cc10472ef1a794cc64
2017-11-21Replace '.' in counter names with ':'Harald Welte1-23/+23
'.' is an illegal character in counter names, as they are exported via CTRL interface, where '.' has a special meaning that cannot be used by strings comprising the variable name. Change-Id: Iec382ec4ee54beb2937431f5a9d8d1171224eebb
2017-11-01vty: skip installing cmds now always installed by defaultNeels Hofmeyr3-3/+0
vty_install_default() and install_default() will soon be deprecated. Depends: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b Change-Id: Iee1b582a62921cb3205de01ff87d94881e8d411b
2017-11-01change default config filename to osmo-sgsn.cfg, not osmo_sgsn.cfgNeels Hofmeyr1-2/+26
All other Osmocom programs I know of have a default config file using a dash. Comply. Be backwards compatible: when a legacy osmo_sgsn.cfg exists but no osmo-sgsn.cfg, use the old config file instead. (Verified to work by manual tests.) Change-Id: If804da17a7481e79e000fe40ae0d9c4be9722e61
2017-10-31drop osmo_sgsn.cfg from src/gprs dirNeels Hofmeyr1-23/+0
There is a semantically identical config in doc/examples/osmo-sgsn. Change-Id: I9b9c502afbddcfc02ea70aa8317e0d2f37276c38
2017-10-27Log address on GTP creationMax1-0/+2
Change-Id: Ic54a2ff835c9a0ceccf2f718f56371a881dd25b7
2017-10-27Log GTP-U endpoints updateMax2-5/+7
* make gtp_ntoa() public after renaming it to sgsn_gtp_ntoa() to avoid confusion with libgtp functions * use it to log GTP-U endpoints address updates Change-Id: I96d0f3a63cce338471cc39cc33fd44c39cd2aa73 Related: SYS#3610
2017-10-26Fix libosmo-sigtran dependencyMax1-2/+4
That's follow-up fix for I72819462db0b4656fabaa80731342d06ae91fcdf to make sure IU builds are properly conditioned. Change-Id: Idb034bf2ae749204836ab7e02018d769bb242a9f
2017-10-26gbproxy: don't link unnecessaryMax1-2/+0
* remove sigtran include from common_vty.c because nothing uses it * remove LIBOSMOSIGTRAN_LIBS from generic OSMO_LIBS * remove LIBOSMOABIS_LIBS from generic OSMO_LIBS Both LIBOSMOSIGTRAN and LIBOSMOABIS are linked explicitly when necessary already anyway. Change-Id: I015a9d858bc2a95f8c9a4aedd3e0a84eadcf84e1
2017-10-25non-iu-build: guard vty libosmo-sigtran function calls.Philipp Maier1-0/+6
The function calls osmo_ss7_vty_go_parent() and gtphub_vty_is_config_node() are not guarded by an ifdef. The functions are only needed for IU support where libosmo-sigtran is used. Guard the function calls with a BUILD_IU Change-Id: I1c609ef0c344ce825c313335c7e084bf97159262
2017-10-25log: fix default loglevelsPhilipp Maier1-9/+9
for some log categories the default loglevel is far to verbose. downgrade all loglevels to LOGL_NOTICE Change-Id: I3a427ce201c96338a00a84d737d090ac1a77a29f
2017-10-20Fix APN printingMax1-18/+2
Previously first character of APN was omitted. Fix this by getting rid of errorneous wrapper function and using osmo_apn_to_str() directly. The breaking change was introduced in I7315ffcbed8a54cca2056f313bb7783ad82d0ee9. Change-Id: Ie13b6cd0066e0370e2adf48d12a363c2e405eaf2 Related: SYS#3610
2017-10-20SGSN: check that GSN is created in proper modeMax1-0/+3
Change-Id: Ie15364fb3c099806ce8a456ef452200305c836f6
2017-10-20SGSN: print additional GTP-related infoMax2-1/+7
* print libgtp version on startup * print GSN addresses in 'sh sgsn' Change-Id: I699a9eb56c4b362984ea8292a3d2b22b71f53c15 Related: SYS#3610
2017-10-17Use new FSF address in license headerMax1-1/+1
The issue was uncovered by lintian while checking .deb packaging. Change-Id: Idfe0e3d61f2604521647e9ef5ffb984db96aabbe
2017-10-09Check for correct P-TMSI allocationMax1-2/+5
Do not assign new P-TMSI if allocation failed. Change-Id: Ifa71bbc8df726c74aceaf9ae3eb49e124a53910a
2017-10-09Move P-TMSI alloc/update into separate functionMax1-13/+16
Remove code duplication by allocating and assigning P-TMSI in a static function. Change-Id: Ie5466326a851867d55da389bf18b240acd3f0fc5
2017-10-02Use extended logging for PDP contextsMax1-2/+3
Log additional details (IMSI, NSAPI etc) on PDP context creation/deletion by using appropriate LOGP() wrappers. Change-Id: I91a126952ae75ae9ba1f42aac4d26413384bba5d Related: SYS#3610
2017-09-23gbproxy: ensure peer allocation resultMax1-2/+2
gbproxy_peer_alloc() could return NULL which wasn't checked and used right away. Fix it by making this assumption explicit with OSMO_ASSERT(); While at it, also format log messages consistently. Change-Id: Ib10c954e17a479baef31ded54370b35938e00018
2017-09-06move include/openbsc to include/osmocom/sgsnNeels Hofmeyr38-169/+169
Change-Id: I281ef585fffc2644682c8282224fb1c2da5ca795
2017-08-30sccp init: pass no local m3ua addr to use defaultsNeels Hofmeyr1-4/+3
Remove the FIXMEs because these addresses are configurable via the cs7 / {as,asp} vty commands. Change-Id: Ibafda0a9097183c26b21f3380d24dbe293e132e2
2017-08-30split off osmo-sgsn: remove files, apply build1.1.0Neels Hofmeyr21-40/+759
Change-Id: I5d27ff93e56cd13e0e70edd15e2080201e35e91f
2017-08-30move libiu to osmo-iuh/libosmo-ranapNeels Hofmeyr6-30/+50
Remove libiu here, use the functions from libosmo-ranap instead, by applying the ranap_ / RANAP_ prefix. Corresponding change-id in osmo-iuh.git is I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 To be able to run the msc_vlr tests for RAN_UTRAN_IU without Iu client headers available, add iu_dummy.h, containing mere function signatures that match iu_dummy.c and a mostly empty struct ranap_ue_conn_ctx. Make sure we can build with and without --enable-iu: include osmo-iuh headers only with --enable-iu. Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b
2017-08-30Implement AoIP, port to M3UA SIGTRAN (large addition and refactoring)Philipp Maier2-1/+18
This was originally a long series of commits converging to the final result seen in this patch. It does not make much sense to review the smaller steps' trial and error, we need to review this entire change as a whole. Implement AoIP in osmo-msc and osmo-bsc. Change over to the new libosmo-sigtran API with support for proper SCCP/M3UA/SCTP stacking, as mandated by 3GPP specifications for the IuCS and IuPS interfaces. From here on, a separate osmo-stp process is required for SCCP routing between OsmoBSC / OsmoHNBGW <-> OsmoMSC / OsmoSGSN jenkins.sh: build from libosmo-sccp and osmo-iuh master branches now for new M3UA SIGTRAN. Patch-by: pmaier, nhofmeyr, laforge Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77
2017-08-27Treat SIGTERM just like SIGINT in our programsHarald Welte3-0/+6
When somebody kills the process, it's best to handle the signal and to use the opportunity for some cleanup. We always did this in the NITB on SIGINT, but never on SIGTERM. Let's change it. Change-Id: Iea6804325a6575ceab5edfd28dd20249462f143b
2017-08-27gbproxy: log signal value as textMax1-6/+4
Change-Id: I6ed923f5c60a8d64305f4b8e90d1362d6510e1c5
2017-08-27gbproxy: log unhandled BSSGP PDU as textMax1-2/+1
Change-Id: Ibe3c8bd353b3a178e26b0936f25b2e1959f9990c
2017-08-27Migrate from gprs_apn_to_str() to libosmocore osmo_apn_to_str()Harald Welte8-51/+17
In 2015, Jacob moved/copied related functions to libosmocore, but for some reason didn't remove the copies here. Let's follow-up on that and remove duplicated code. The libosmocore commit introducing osmo_apn_to_str() was 8114294bf29ac6e44822c0ae43d4b0819f11b022 Change-Id: I7315ffcbed8a54cca2056f313bb7783ad82d0ee9
2017-08-27sgsn_vty: Don't assume pdp->lib is always validHarald Welte1-14/+16
We can only print libgtp pdp information if a library context is attached to this pdp context. This is not always the case, particuarly during some teardown scenarios. Change-Id: Ia3184877f9709db65f5f93a98403f2ef5b04a8ca
2017-08-27SGSN: Fix RAN information exposed on GTP during PDP CTX CREATEHarald Welte1-7/+18
In the PDP Context Create from SGSN to GGSN, we include information about the RAN type (GERAN/UTRAN) and the Cell of the MS. This was all hard-coded to GERAN, and wasn't updated when we added UTRAN support to the SGSN. Change-Id: I6c79e42c5e08b28fe8182555302a5505fbbaa313
2017-08-27sgsn: Convert cch_pdp to host order for libgtpHolger Hans Peter Freyther1-5/+2
libgtp is calling gtpie_tv2 which will convert this uint16_t from host to network order. So far libosmogsm and the sgsn treated the charging characteristics as opaque data. So when moving from byte array to the uint16_t do the swapping. Change-Id: I977aec2e2f8d57802e45f591754e5733562d5c2a
2017-08-27gtphob: check for missing result of rate_ctr_group_alloc()Harald Welte1-0/+4
In case the counter group allocation fails, we must handle this gracefully and fail the allocation of the parent object, too. The recent change (Id I7dad4a4d52fe05f6b990359841b4408df5990e21) seems to have missed one instance, so let's follow-up. Change-Id: I1ee9e3d26dcc18e7f979fd9a786162cbcc50942c Related: OS#2361
2017-08-27check for missing result of rate_ctr_group_alloc()Harald Welte3-0/+24
In case the counter group allocation fails, we must handle this gracefully and fail the allocation of the parent object, too. RelateD: OS#2361 Change-Id: I7dad4a4d52fe05f6b990359841b4408df5990e21
2017-08-27sgsn: Fill the cch_pdp with a value coming from the tlv structureHolger Hans Peter Freyther3-5/+37
For some GGSNs we need to insert the PDP Charging Characteristics that were returned. We receive these values from GSUP and will fill them into the tlv structure when finding the ggsn context. Change-Id: I1725bfd2403d29ce3550bfcd6fcc1498426ef906
2017-08-27Implement IuCS (large refactoring and addition)Neels Hofmeyr5-12/+24
osmo-nitb becomes osmo-msc add DIUCS debug log constant add iucs.[hc] add msc vty, remove nitb vty add libiudummy, to avoid linking Iu deps in tests Use new msc_tx_dtap() instead of gsm0808_submit_dtap() libmgcp: add mgcpgw client API bridge calls via mgcpgw Enable MSC specific CTRL commands, bsc_base_ctrl_cmds_install() still needs to be split up. Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88
2017-08-27sgsn init: pass sgsn_config pointer to sgsn_vty_init(), not sgsn_parse_configNeels Hofmeyr2-5/+8
In an upcoming commit, sgsn_vty_init() will require access to the global sgsn config struct to initialize a generic VTY command with the proper config destination address, see Change-Id I5b5b6a9678b458affa86800afb1ec726e66eed88. Change-Id: Ie6b6e5422987586531a898e0c5b867623dbecb0f
2017-08-27SGSN: Don't indicate GERAN in Iu mode PDP CTX ACT REQ to GGSNHarald Welte1-10/+20
Change-Id: Ifd9ff4342de342475609bad0257a23c50290e23b