path: root/src/sim/card_fs_sim.c
AgeCommit message (Collapse)AuthorFilesLines
2020-03-21card_fs_sim: Avoid '/' in file namesHarald Welte1-1/+1
... as that doesn't work if we want to create a similarly-named file in the local file system. Change-Id: Ib8734e2e4b81c915ab0fbd0d9b6662275b1d33d1
2018-04-08fix spellingThorsten Alteholz1-1/+1
fix for some spelling issues found by lintian Signed-off-by: Thorsten Alteholz <osmocom@alteholz.de> Change-Id: I69976ecae6939d9ff51bfe4ce7374890c6563b82
2018-02-28implement support for 3-digit MNC with leading zerosNeels Hofmeyr1-0/+1
Enable representing three-digit MNC with leading zeros. The MNCs 23 and 023 are actually different; so far we treated both as 23. Re-encode an incoming BCD or string of 023 as it were, i.e. not dropping the leading zero as 23. Break ABI compatibility by changing the size and ordering of structs gprs_ra_id, osmo_plmn_id, osmo_cell_global_id, ... by adding an mnc_3_digits flag. Change ordering in gprs_ra_id because the canonical oder is {Mobile Country Code, Mobile Network Code}, so have the mcc member first. ABI compatibility cannot be maintained for struct gprs_ra_id, since it is a direct member of structs bssgp_bvc_ctx and bssgp_paging_info, and even just adding a flag to the end would cause ABI changes of those structs. Similarly, osmo_plmn_id is a direct member of osmo_location_area_id, and so forth. Add new API to set and read this additional flag to preserve leading zeros: - osmo_plmn_to_bcd(), osmo_plmn_from_bcd() after gsm48_mcc_mnc_to_bcd() and gsm48_mcc_mnc_from_bcd(). - gsm48_decode_lai2(), gsm48_generate_lai2() after gsm48_decode_lai(), gsm48_generate_lai(). - gsm0808_create_layer3_2() after gsm0808_create_layer3() and gsm0808_create_layer3_aoip(). - various osmo_*_name() functions in gsm23003.h (osmo_rai_name() still in gsm48.h close to struct gprs_ra_id definition). The amount and duplication of these may seem a bit overboard, but IMO they do make sense in this way. Though most code will soon see patches unifying the data structures used, in some cases (vty, ctrl) they are required singled out. Without these functions, the formatting ("%0*u", mnc_3_digits ? 3 : 2, mnc) would be duplicated all over our diverse repositories. In various log output, include the leading MNC zeros. Mark one TODO in card_fs_sim.c, I am not sure how to communicate a leading zero to/from a SIM card FS. The focus here is on the core network / BSS. To indicate ABI incompatibility, bump libosmogsm and libosmogb LIBVERSIONs; adjust debian files accordingly. Implementation choices: - The default behavior upon zero-initialization will be the mnc_3_digits flag set to false, which yields exactly the previous behavior. - I decided against packing the mnc with the mnc_3_digits field into a sub-struct because it would immediately break all builds of dependent projects: it would require immediate merging of numerous patches in other repositories, and it would make compiling older code against a newer libosmocore unneccessarily hard. Change-Id: Id2240f7f518494c9df6c8bda52c0d5092f90f221
2017-11-13Fix/Update copyright notices; Add SPDX annotationHarald Welte1-0/+2
Let's fix some erroneous/accidential references to wrong license, update copyright information where applicable and introduce a SPDX-License-Identifier to all files. Change-Id: I39af26c6aaaf5c926966391f6565fc5936be21af
2017-06-23doxygen: unify use of \file across the boardNeels Hofmeyr1-1/+2
Considering the various styles and implications found in the sources, edit scores of files to follow the same API doc guidelines around the doxygen grouping and the \file tag. Many files now show a short description in the generated API doc that was so far only available as C comment. The guidelines and reasoning behind it is documented at https://osmocom.org/projects/cellular-infrastructure/wiki/Guidelines_for_API_documentation In some instances, remove file comments and add to the corresponding group instead, to be shared among several files (e.g. bitvec). Change-Id: Ifa70e77e90462b5eb2b0457c70fd25275910c72b
2014-10-26make sure to register DF.TELECOM and DF.GSM for SIM, USIM + TSIMHarald Welte1-18/+38
before we only did it partially, and by exporting data from sim, rather than the new osim_int_cprof_add_{gsm,telecom}() functions.
2014-10-26sim: Only one default_decode() function for all card typesHarald Welte1-13/+0
2014-10-26sim: Update to latest SIM/USIM specs and include size informationHarald Welte1-76/+140
2014-10-26sim: add copyright notices and merge file_codec.c into core.cHarald Welte1-0/+21
2014-10-26initial checkin of 'libosmosim'Harald Welte1-0/+385