summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* add OSMO_STRBUF_PRINTF()Neels Hofmeyr2019-02-172-0/+103
| | | | | | | | | | We are using macros like this or different workarounds in libmsc. In the course of implementing inter-MSC handover, I am encountering yet another such situation of appending multiple strings to a limited char buffer. Standardize. Add a unit test to utils_test.c. Change-Id: I2497514e26c5e7a5d88985fc7e58343be1a027b2
* Enable remote SIM protocol log levelMax2019-02-141-1/+1
| | | | | | | It's defined in logging.h for quite some time but is not actually enabled alongside with other internal logging categories. Change-Id: I0e7a2add6293a072752900608c8ba34cc3850f31
* platform independence fix: tdef range testsNeels Hofmeyr2019-02-068-133/+490
| | | | | | | | | | | | | Run INT_MAX and ULONG_MAX related tests only manually, remove from automatic testing. This will hopefully fix recent build failures on various platforms. Add a 64 bit output example for expected results when invoking `./tdef_test range'. This is not checked automatically and merely serves for manual reference. For vty tests, use 32bit max values instead of INT_MAX and ULONG_MAX. Change-Id: I6242243bde1d7ddebb858512a1f0b07f4ec3e5c2
* bitvec: Add bitvec_tailroom_bits() functionHarald Welte2019-02-051-0/+19
| | | | | | | | | This is similar to msgb_tailroom(): It returns the amount of space left at the end of the bit vector (compared to the current cursor). The function returns the number of bits left in the bitvec. Change-Id: I8980a6b6d1973b67a2d9ad411c878d956fb428d1
* bitvec: Add bitvec_bytes_used() functionHarald Welte2019-02-052-0/+28
| | | | | | | This new bitvec API function returns the number of bytes used in a given bit-vector. Change-Id: Id4bd7f7543f5b0f4f6f876e283bd065039c37646
* add osmo_tdef API, originally adopted from osmo-bsc T_defNeels Hofmeyr2019-02-0410-0/+2095
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move T_def from osmo-bsc to libosmocore as osmo_tdef. Adjust naming to be more consistent. Upgrade to first class API: - add timer grouping - add generic vty support - add mising API doc - add C test - add VTY transcript tests, also as examples for using the API From osmo_fsm_inst_state_chg() API doc, cross reference to osmo_tdef API. The root reason for moving to libosmocore is that I want to use the mgw_endpoint_fsm in osmo-msc for inter-MSC handover, and hence want to move the FSM to libosmo-mgcp-client. This FSM uses the T_def from osmo-bsc. Though the mgw_endpoint_fsm's use of T_def is minimal, I intend to use the osmo_tdef API in osmo-msc (and probably elsewhere) as well. libosmocore is the most sensible place for this. osmo_tdef provides: - a list of Tnnnn (GSM) timers with description, unit and default value. - vty UI to allow users to configure non-default timeouts. - API to tie T timers to osmo_fsm states and set them on state transitions. - a few standard units (minute, second, millisecond) as well as a custom unit (which relies on the timer's human readable description to indicate the meaning of the value). - conversion for standard units: for example, some GSM timers are defined in minutes, while our FSM definitions need timeouts in seconds. Conversion is for convenience only and can be easily avoided via the custom unit. By keeping separate osmo_tdef arrays, several groups of timers can be kept separately. The VTY tests in tests/tdef/ showcase different schemes: - tests/vty/tdef_vty_test_config_root.c: Keep several timer definitions in separately named groups: showcase the osmo_tdef_vty_groups*() API. Each timer group exists exactly once. - tests/vty/tdef_vty_test_config_subnode.c: Keep a single list of timers without separate grouping. Put this list on a specific subnode below the CONFIG_NODE. There could be several separate subnodes with timers like this, i.e. continuing from this example, sets timers could be separated by placing timers in specific config subnodes instead of using the global group name. - tests/vty/tdef_vty_test_dynamic.c: Dynamically allocate timer definitions per each new created object. Thus there can be an arbitrary number of independent timer definitions, one per allocated object. T_def was introduced during the recent osmo-bsc refactoring for inter-BSC handover, and has proven useful: - without osmo_tdef, each invocation of osmo_fsm_inst_state_chg() needs to be programmed with the right timeout value, for all code paths that invoke this state change. It is a likely source of errors to get one of them wrong. By defining a T timer exactly for an FSM state, the caller can merely invoke the state change and trust on the original state definition to apply the correct timeout. - it is helpful to have a standardized config file UI to provide user configurable timeouts, instead of inventing new VTY commands for each separate application of T timer numbers. Change-Id: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5
* vty: enable optional-multi-choice syntax: [(one|two)]Neels Hofmeyr2019-02-042-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | Since very recently we sensibly handle commands like cmd ([one]|[two]|[three]) as optional multi-choice arguments. In addition, support the more obvious syntax of cmd [(one|two|three)] Internally, the tokens are mangled to [one] [two] and [three], which is how the rest of the code detects optional args, and makes sense in terms of UI: > cmd ? [one] [two] [three] (i.e. optional arguments are always shown in braces in '?' listings) Before this patch, commands defined with a syntax like [(one|two)], would lead to an assertion (shows as "multiple") during program startup. Change-Id: I952b3c00f97e2447f2308b0ec6f5f1714692b5b2
* vty: enable optional-multi-choice syntax: ([one]|[two])Neels Hofmeyr2019-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add basic optional multi-choice argument support. The VTY detects optional arguments by square braces. > cmd ? [optional-arg] > cmd optional-arg ok > cmd ok However, within multi-choice args, these braces were so far not treated as optional: > list cmd2 ([one]|[two]|[three]) > cmd2 % Command incomplete In preparation for I952b3c00f97e2447f2308b0ec6f5f1714692b5b2 which will enable the more obvious syntax of cmd [(one|two)] for reasons of internal implementation, first support a syntax of cmd ([one]|[two]) The internal vty implementation always needs square braces around each option. There is currently no good way to prevent developers from defining braces inside multi-arguments, so it is easiest to allow and handle them: > list cmd2 ([one]|[two]|[three]) > cmd2 ok The VTY doesn't guard against a mix like cmd (one|[two]) With this patch, a multi-choice command is treated as optional iff the first element is in square brackets. The remaining elements' square brackets have no effect besides confusing the user. This is not explicitly checked against. In general, I would prefer to check all of these details, but the current VTY code with its endless code duplication and obscure string mangling just doesn't provide that luxury. There are numerous worse errors hidden in there. Change-Id: I9a8474bd89ddc2155c58bfca7bd038d586aaa60a
* add generic vty_transcript_test.c, vty_transcript_test.vtyNeels Hofmeyr2019-02-043-2/+301
| | | | | | | | I want to tweak general VTY features and need to cover with a transcript test to show the differences. Start by showing the current situation of optional and multi-choice arguments. Change-Id: I5a79c83fabd02aba6406b6e0d620969c4bd0cc1d
* osmo_fsm_inst_state_chg(): set T also for zero timeoutNeels Hofmeyr2019-01-293-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, if timeout_secs == 0 was passed to osmo_fsm_inst_state_chg(), the previous T value remained set in the osmo_fsm_inst->T. For example: osmo_fsm_inst_state_chg(fi, ST_X, 23, 42); // timer == 23 seconds; fi->T == 42 osmo_fsm_inst_state_chg(fi, ST_Y, 0, 0); // no timer; fi->T == 42! Instead, always set to the T value passed to osmo_fsm_inst_state_chg(). Adjust osmo_fsm_inst_state_chg() API doc; need to rephrase to accurately describe the otherwise unchanged behaviour independently from T. Verify in fsm_test.c. Rationale: it is confusing to have a T number remaining from some past state, especially since the user explicitly passed a T number to osmo_fsm_inst_state_chg(). (Usually we are passing timeout_secs=0, T=0). I first thought this behavior was introduced with osmo_fsm_inst_state_chg_keep_timer(), but in fact osmo_fsm_inst_state_chg() behaved this way from the start. This shows up in the C test for the upcoming tdef API, where the test result printout was showing some past T value sticking around after FSM state transitions. After this patch, there will be no such confusion. Change-Id: I65c7c262674a1bc5f37faeca6aa0320ab0174f3c
* build: add missing logging_vty_test.vty to EXTRA_DISTNeels Hofmeyr2019-01-291-0/+1
| | | | | | | | | | It was introduced and forgotten to add to EXTRA_DIST in: "logging vty: add VTY transcript test" commit 3a9ff11e574fa7ee19b1062b2c90151dbf7f0e27 change-Id I948e832a33131f8eab98651d6010ceb0ccbc9a9c Change-Id: I1bcedf3097f02b2adc679560d1cbceb27dbc345e
* add osmo_hexdump_buf() and testNeels Hofmeyr2019-01-282-0/+122
| | | | | | | | | | | | | | | | | | Add osmo_hexdump_buf() as an all-purpose hexdump function, which all other osmo_hexdump_*() implementations now call. It absorbs the static _osmo_hexdump(). Add tests for osmo_hexdump_buf(). Rationale: recently during patch review, a situation came up where two hexdumps in a single printf would have been useful. Now I've faced a similar situation again, in ongoing development. So I decided it is time to provide this API. The traditional osmo_hexdump() API returns a non-const char*, which should probably have been a const instead. Particularly this new function may return a string constant "" if the buf is NULL or empty, so return const char*. That is why the older implementations calling osmo_hexdump_buf() separately return the buffer instead of the const return value directly. Change-Id: I590595567b218b24e53c9eb1fd8736c0324d371d
* gsm0808: add BSSMAP Cell Identifier matching APINeels Hofmeyr2019-01-282-0/+459
| | | | | | | | | | | | | | | | | | | | | | | | | Add * osmo_lai_cmp() (to use in gsm0808_cell_id_u_matches()) * osmo_cgi_cmp() (to use in gsm0808_cell_id_u_matches()) * gsm0808_cell_id_u_match() (to re-use for single IDs and lists) * gsm0808_cell_ids_match() * gsm0808_cell_id_matches_list() * Unit tests in gsm0808_test.c Rationale: For inter-BSC handover, it is interesting to find matches between *differing* Cell Identity kinds. For example, if a cell as CGI 23-42-3-5, and a HO for LAC-CI 3-5 should be handled, we need to see the match. This is most interesting for osmo-msc, i.e. to direct the BSSMAP Handover Request towards the correct BSC or MSC. It is also interesting for osmo-bsc's VTY interface, to be able to manage cells' neighbors and to trigger manual handovers by various Cell Identity handles, as the user would expect them. Change-Id: I5535f0d149c2173294538df75764dd181b023312
* gsm0408_test: Fix IMEI-SV related tests to use no more than 16 digitsHarald Welte2019-01-222-16/+16
| | | | | | | | The IMEI-SV is speified as a 16 digit number: 14 digits of IMEI plus two digits of software version. Let's not try to feed 18 digit long numbers into our functions, as the resulting behavior is unspecified. Change-Id: I6fb85a0516dc387902ad9de4fe8c1ba82d68cae6
* LCLS: make GCR into static member of osmo_lclsMax2019-01-191-18/+22
| | | | | | | | | Most of the time we'll have GCR filled anyway so it make sense to have it as static parameter instead of a pointer to separately allocated structure. Update tests to cover both static and dynamic osmo_lcls allocation variants. Change-Id: I905c36d8455911c68c30bc429379b7313dd46aea
* LCLS: add status parameter to Assignment Completed messageMax2019-01-191-4/+5
| | | | | | | | | | * add gsm0808_create_ass_compl2() with additional gsm0808_lcls_status parameter and make gsm0808_create_ass_compl() into trivial wrapper around it * update tests accordingly Change-Id: I547c6b8707123aa8c1ef636db88908df112d90a4 Related: OS#2487
* LCLS: add GCR comparison helperMax2019-01-141-19/+4
| | | | Change-Id: I9e3b5560a058b976638d03cb819415d237ae9984
* LCLS: expand enc/dec testsMax2019-01-141-0/+12
| | | | Change-Id: I8ed87f26216104d34c7bd11c1527b203843760a2
* gsm23003: add osmo_imei_str_valid()Oliver Smith2019-01-142-0/+54
| | | | | | | | | | | Verify 14 digit and 15 digit IMEI strings. OsmoHLR will use the 14 digit version to check IMEIs before writing them to the DB. Place the Luhn checksum code in a dedicated osmo_luhn() function, so it can be used elsewhere. Related: OS#2541 Change-Id: Id2d2a3a93b033bafc74c62e15297034bf4aafe61
* port arfcn range encode support from osmo-bscStefan Sperling2019-01-122-0/+402
| | | | | | | | | | | | | | As part of fixing issue OS#3075, we want to migrate support for encoding system information from osmo-bsc to libosmocore. This change ports one of the prerequisites for doing so: osmo-bsc code for range-encoding ARFCNs, including tests. An osmo_gsm48_ prefix has been prepended to public symbols in order to avoid clashes with existing symbols in osmo-bsc code. Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c Related: OS#3075
* add osmo_mi_name(), for MI-to-string like "IMSI-123456"Neels Hofmeyr2019-01-082-0/+44
| | | | | | | | We have gsm48_mi_to_string() and osmo_bcd2str(), but still lack a function that conveniently prints both MI type and value in one function call. Related: http://people.osmocom.org/neels/mi_mi_mi.jpg Change-Id: I7798c3ef983c2e333b2b9cbffef6f366f370bd81
* tests/gsup_test.c: drop session IEs from MO-ForwardSM ErrorVadim Yanitskiy2019-01-052-10/+4
| | | | | | | | Both session state and session ID IEs were left from the initial version of Ibe325c64ae2d6c626b232533bb4cbc65fc2b5d71. There is no need to use them (as we use SM-RP-MR), so let's clean up. Change-Id: I0d910b87f15ffbc0aeeca9cb4fcbef32bdf3ef88
* LCLS: enc/dec entire parameter set instead of GCRMax2018-12-231-13/+20
| | | | | | | | | | | | | In 3GPP TS 48.008 the Global Call Reference IE is only used in HANDOVER REQUEST (§3.2.1.8) and ASSIGNMENT REQUEST (§3.2.1.1) messages which also include LCLS Config and CSC parameters. Hence, there's no point in using GCR encode/decode functions alone. Introduce gsm0808_dec_lcls() and gsm0808_enc_lcls() as trivial wrappers on top of GCR enc/dec routines which are made static. Adjust tests accordingly. Test output intentionally left unchanged. Change-Id: Icfbb2404e1a1d500243e2071173299b557369335
* tests/gsm0808: use new msgb comparison APIVadim Yanitskiy2018-12-211-12/+4
| | | | | | | | Since I3bc95f2f5ab6e3f4b502647fb3e0aaaf1f7c4cf5, we have some helpers to compare certain msgb layer to a given buffer. Let's change 'VERIFY' macro to use msgb_eq_l3_data_print(). Change-Id: Ib6be778236eff8f2153f3113f9379ecfbec9052b
* GSUP: add CHECK-IMEI messageOliver Smith2018-12-213-0/+54
| | | | | | | | | | | | | | Implement necessary messages for Procedure Check_IMEI_VLR (TS 23.018 Chapter 7.1.2.9). This lets the VLR ask the EIR to check if an IMEI is valid. In the Osmocom stack, we don't have an EIR and this request will be handled by the HLR. We will be able to store the IMEI in the HLR as side-effect (OS#2541). This is roughly based on TS 29.002 8.7.1 MAP_CHECK_IMEI service, but only implements the bare minimum required IEs (imei and imei_result). Related: OS#3733 Change-Id: I085819df0ea7f3bfeb0cabebb5fd1942a23c6155
* GSUP: add end marker to enum osmo_gsup_ieiOliver Smith2018-12-211-5/+1
| | | | | | | | | | | | | Simplify gsup_test.c by defining an end marker in gsup.h. No need to manually update the last element every time anymore. The C standard guarantees, that the end marker will have the last value plus one: "Each subsequent enumerator with no = defines its enumeration constant as the value of the constant expression obtained by adding 1 to the value of the previous enumeration constant." (From C99: 6.7.2.2 Enumeration specifiers) Change-Id: I2aab7245e209f0ebd2f33a83d4d181dd3339cb17
* Use define for key buffersMax2018-12-201-1/+4
| | | | | | Add corresponding spec. references and comments where appropriate. Change-Id: If5e2aad86eaecd8eada667b3488ba415d81c6312
* add/clean big-endian packed structs (struct_endianess.py)Neels Hofmeyr2018-12-191-0/+1
| | | | | | | | | | | | | | This is 1:1 the result of doing cd libosmocore ./contrib/struct_endianess.py git commit -a Running struct_endianess.py again should result in no changes. That means we could include such a check in the gerrit verification job now. Change-Id: Ia0b99d76932aeb03e93bd0c62d3bf025dec5f9d2
* GSUP/SMS: introduce READY-FOR-SM messageVadim Yanitskiy2018-12-183-1/+19
| | | | | | | | | | | | | | | According to 3GPP TS 29.002, section 12.4, MAP-READY-FOR-SM is used between the MSC and VLR as well as between the VLR and the HLR to indicate that a subscriber has memory available for SMS. This change replicates this service in GSUP as READY_FOR_SM_*. The only mandatory IE for this service (excluding Invoke ID) is 'Alert Reason' that is replicated by OSMO_GSUP_SM_ALERT_RSN_IE. Change-Id: Ic37f3b2114b8095cfce22977e67133b9103942e3 Related Change-Id: (docs) I549b6c8840a1e86caac09e77fb8bc5042d939e62 Related Change-Id: (TTCN) If2256607527ecfcb10285583332fb8b0515d7c78 Related: OS#3587
* GSUP/SMS: introduce MO-/MT-FORWARD-SM messagesVadim Yanitskiy2018-12-183-13/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to 3GPP TS 29.002, there are two services: - MAP-MO-FORWARD-SHORT-MESSAGE (see 12.2), - MAP-MT-FORWARD-SHORT-MESSAGE (see 12.9), which are used to forward MO/MT short messages. This change replicates both services as GSUP messages: - OSMO_GSUP_MSGT_MO_FORWARD_SM_*, - OSMO_GSUP_MSGT_MT_FORWARD_SM_*. Please note, that only the 'must-have' IEs are introduced by this change, in particular the following: - OSMO_GSUP_SM_RP_MR_IE (see note below), - OSMO_GSUP_SM_RP_DA_IE (see 7.6.8.1), - OSMO_GSUP_SM_RP_OA_IE (see 7.6.8.2), - OSMO_GSUP_SM_RP_UI_IE (see 7.6.8.4), - OSMO_GSUP_SM_RP_MMS_IE (see 7.6.8.7), - OSMO_GSUP_SM_RP_CAUSE_IE (see GSM TS 04.11, 8.2.5.4), where both SM_RP_DA and SM_RP_OA IEs basically contain a single nested TV of the following format: - T: identity type (see 'osmo_gsup_sms_sm_rp_oda_t'), - V: encoded identity itself (optional). According to GSM TS 04.11, every single message on the SM-RL has an unique message reference (see 8.2.3), that is used to link an RP-ACK or RP-ERROR message to the associated (preceding) RP-DATA or RP-SMMA message transfer attempt. In case of TCAP/MAP, this message reference is being mapped to the Invoke ID. But since GSUP has no 'Invoke ID' IE, and it is not required for other applications (other than SMS), this change introduces a special 'SM_RP_MR' IE that doesn't exist in MAP. Change-Id: Ibe325c64ae2d6c626b232533bb4cbc65fc2b5d71 Related Change-Id: (docs) Ie0150756c33c1352bc4eb49421824542c711175c Related Change-Id: (TTCN) Ibf49474a81235096c032ea21f217170f523bd94e Related: OS#3587
* LCLS: add gsm0808_create_ass2()Max2018-12-142-0/+79
| | | | | | | It allows setting additional assignment parameters explicitly. Change-Id: Id89765df3f8c12f55f73f1d7a9d90c8883eb3bba Related: OS#2487
* LCLS, TS 48.008: add GCR IE encoding/decodingMax2018-12-142-0/+81
| | | | | | | | * add functions to encode Global Call. Ref. from TS 29.205 as 3GPP TS 48.008 §3.2.2.115 information element * add corresponding tests Change-Id: I82ce0207dc8de50689a8806c6471ad7fbae6219d
* LCLS, TS 29.205: add GCR routinesMax2018-12-144-2/+123
| | | | | | | | Add functions to encode and decode Global Call Reference as per 3GPP TS 29.205 Table B 2.1.9.1 add corresponding tests. Change-Id: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf Related: OS#2487
* gsm48_mi_to_string(): guard against zero length output bufferNeels Hofmeyr2018-12-101-8/+8
| | | | | | | | All successful cases already return from the switch(), so simply handle all errors below it by returning an empty string (if there is enough string buffer). Change-Id: I709ac3b9efb7b4258d8660715b10312e11b9b571
* gsm48_generate_mid(): mask out ODD flag from mi_typeNeels Hofmeyr2018-12-102-7/+5
| | | | | | | | For MI encoding, see 3GPP TS 24.008, 10.5.1.4 Mobile Identity. The 'odd' flag indicates whether the last BCD nibble is used. Of course that flag should be made sure to reflect the actual length. Change-Id: Id6e695ebf9f86b295eaa7e2c6228989256f37e68
* gsm48_mi_to_string: use osmo_bcd2str(), fix some corner casesNeels Hofmeyr2018-12-102-16/+12
| | | | | | | | | | | | | By using osmo_bcd2str(), ensure that the resulting string is always nul terminated, and always return strlen()+1 whether truncated or not. Still keep up the previous return value style, even if that isn't consistent at all. The difference between IMSI/IMEI and TMSI return values remains and is not part of this patch. Change-Id: I1b51b72a721e1cc9d69796b804ebda741ff0f36b
* add osmo_bcd2str()Neels Hofmeyr2018-12-102-0/+143
| | | | | | | | | | | | | | | | | | Add a standalone bcd-to-string conversion function with generic parameters. Add a regression test in utils_test.c. So far there is no single universal implementation that converts a BCD to a string. I could only find gsm48_mi_to_string(), which also interprets surrounding bytes, MI type and TMSI as non-BCD value. The idea is to use this function from gsm48_mi_to_string() and similar implementations in subsequent commits. Root cause: in osmo-msc, I want to have an alternative MI-to-string function for composing an FSM name, which needs the BCD part of gsm48_mi_to_string() but not the TMSI part. Change-Id: I86b09d37ceef33331c1a56046a5443127d6c6be0
* gsm0408_test: test encoding and decoding Mobile IdentityNeels Hofmeyr2018-12-102-0/+358
| | | | | | | | | | | | | | | | | | | | | | | | | | | | One would think by now we would solidly encode and decode Mobile Identities. Well, guess again. - rc is sometimes the amount of bytes written, sometimes actual strlen(). - on string truncation, rc is sometimes strlen() (assuming nul terminated), and sometimes snprintf()-style would-be strlen(). - returned string, when truncated by not enough buffer size, is sometimes nul terminated, sometimes not. - gsm48_mi_to_string() happily reads a byte from zero-length input buffer. - gsm48_mi_to_string() happily writes to zero length output buffer. - gsm48_mi_to_string() returns nonempty string for empty input. - encoding a MI type that still has the GSM_MI_ODD flag set results in encoding an even-length MI as odd-length (hence appending a stray 'F'). I am going to tweak the implementation of gsm48 mobile identity encoding / decoding, so first pinpoint the current behavior in a unit test, and show how perforated even such a seemingly trivial API can be. Change-Id: Iaae3af87f82f1a8f2e6273984c011b2813038cf7
* gsm0808: add encoder for cause codes and use itPhilipp Maier2018-12-082-7/+31
| | | | | | | | | | | | | | | | At the moment the all gsm0808 cause codes are encoded directly using the tlv API directly to put a one byte TLV field. This works ok for most situations where the cause code consists of a single byte. However, gsm0808 specifies a two byte cause code model where cause codes may be extended up to two bytes. Instead of implementing the encoding over and over and again, let's rather have an encoder function we can call. - Add an encoder function that can generate single byte and extended cause codeds and makes the length decision automatically. - Use only this function to append cause codes Change-Id: I71d58fad89502a43532f60717ca022c15c73f8bb
* send NS_POUT_UNBLOCK_ACK before signalling S_NS_UNBLOCKStefan Sperling2018-11-191-5/+5
| | | | | | | | | | | | | | | | | | | | | In gprs_ns_process_msg(), we were dispatching the S_NS_UNBLOCK signal before sending out the NS_POUT_UNBLOCK_ACK message. Signal handlers might send messages to the other side, assuming that NS is now unblocked. However, since such messages will arrive before the UNBLOCK_ACK message the receiver might discard them. This problem has been observed with our TTCN3 BSSGP_Emulation as a peer to osmo-pcu. This patch makes TTCN3 PCU TC_paging() test pass regardless of whether the test or osmo-pcu is started first. Before this patch, this test would only pass if the test was started before osmo-pcu. A remaining problem is that the test does not yet keep passing reliably unless osmo-pcu is restarted between test runs. Change-Id: I3af54a14bb6bcfa167c9a9d9f67835e7f5b9f1bb Related: OS#2890 Related: OS#2388
* Support cipher mode reject with extended causeMax2018-11-192-1/+44
| | | | | | | | | | | | | * add function to generate cipher mode reject with extended (2-byte) Cause IE * add function to get (extended) Cause value * add corresponding (extended cause) test